ERROR: Received authentication challenge is null

Hi Rob,

Code sample:

local url = "....." local body = "" local params = {headers={}} params.body = body params.headers["content-length"] = body:len() params.headers["Content-Type"] = "application/x-www-form-urlencoded" params.headers["EX-Device-Type"] = deviceType params.headers["EX-Device-Token"] = deviceToken params.headers["EX-API-Key"] = "....." params.headers["EX-Device-UUID"] = uuid network.request(url, "GET", [EventListener], params)

It works fine on ios.

You have taken out way too much information to help.  Are you URL encoding the URL?  iOS and Android can handle URL requests differently.  For instance, looking at the code you provided, the body is an empty string.  You’re setting the content-length to 0 and honestly you’re doing a GET request, so there is no need to provide a body or set the content length, but if you are setting it to 0, it might trigger an unexpected behavior in what Android passes to the server.

Rob

It’s everything of them.

local BP = { APIKEY\_BP = "7b6d669945bcfefad24a4d555c062c53d7f92a575cd159141b3d1cc046527bb4a3d3e00af326f06f3bfc20c044b4853337bc70855700361ca4282dd64f3c137a", URLH\_INTERNAL = "http://bp-internal\_api.", URLENDPOINT = "twirllook.com" URLH\_CONFIG = "http://app-static.s3.amazonaws.com/config/", URL\_INTERNAL\_API = nil, completed\_0 = nil, completed\_n = nil, errorOccured = nil, } local function defaultEventListener(event) print(event.response) print(event.isError) print(event.status) local errorFlag = 0 if true == event.isError then errorFlag = 1 end local decoded = nil if nil == event.response then errorFlag = 1 else decoded = json.decode(event.response) end event.decoded = decoded if nil == decoded then errorFlag = 1 else if false == decoded.result then errorFlag = 1 end end local completed\_0 = BP.completed\_0 local completed\_n = BP.completed\_n local errorOccured = BP.errorOccured BP.completed\_0 = nil BP.completed\_n = nil BP.errorOccured = nil if 0 == errorFlag then if 0 == decoded.code then if nil ~= completed\_0 then completed\_0(event) end else if nil ~= completed\_n then completed\_n(event) end end else if nil ~= errorOccured then errorOccured(event) end end end function BP:getInfo(uuid, deviceToken, deviceType, completed\_0, completed\_n, erroccured) if nil ~= BP.completed\_0 or nil ~= BP.completed\_n then return end BP.completed\_0 = completed\_0 BP.completed\_n = completed\_n BP.errorOccured = erroccured local api = "/v1/users/info" local uri = (nil ~= BP.URL\_INTERNAL\_API and BP.URL\_INTERNAL\_API or (BP.URLH\_INTERNAL..BP.URLENDPOINT))..api local params = {headers={}} params.headers["BP-Device-Type"] = deviceType params.headers["BP-Device-Token"] = deviceToken params.headers["BP-API-Key"] = BP.APIKEY\_BP params.headers["BP-Device-UUID"] = uuid print("getInfo") network.request(uri, "GET", defaultEventListener, params) end

In the above, I fixed the part you point out. But a result didn’t change. 

12-31 09:22:15.921 I/Corona  (23725): getInfo

12-31 09:22:15.923 D/dalvikvm(23725): threadid=16: bye!

12-31 09:22:15.924 D/dalvikvm(23725): threadid=0: freeing

12-31 09:22:15.924 D/dalvikvm(23725): threadid=16: interp stack at 0x591c8000

12-31 09:22:15.924 D/dalvikvm(23725): threadid=16: calling run()

12-31 09:22:15.925 I/System.out(23725): [socket][13] connection internal.twirllook.com/54.92.121.255:80;LocalPort=33520(30000)

12-31 09:22:15.926 I/System.out(23725): [CDS]connect[internal.twirllook.com/54.92.121.255:80] tm:30

12-31 09:22:15.927 E/Posix   (23725): [CDS]Libcore_io_Posix-throwErrnoException, functionName: connect; errno: Operation now in progress

12-31 09:22:15.927 D/Posix   (23725): [Posix_connect Debug]Process jp.co.bluepay.wallets :80 

12-31 09:22:15.934 D/BatteryService(  240): updateLightsLocked level =100 status 5

12-31 09:22:15.934 V/LightsService(  240): setLightLocked #3: color=#ff00ff00

12-31 09:22:15.938 D/BatteryService(  240): updateLightsLocked level =100 status 5

12-31 09:22:15.939 V/LightsService(  240): setLightLocked #3: color=#ff00ff00

12-31 09:22:15.940 D/BatteryService(  240): updateLightsLocked level =100 status 5

12-31 09:22:15.941 V/LightsService(  240): setLightLocked #3: color=#ff00ff00

12-31 09:22:16.040 I/System.out(23725): [socket][/192.168.19.113:33520]

12-31 09:22:16.040 I/System.out(23725): rx timeout:30000

12-31 09:22:16.060 V/ActivityManager(  240): Broadcast sticky: Intent { act=android.intent.action.SIG_STR flg=0x20000010 (has extras) } ordered=false

12-31 09:22:16.061 D/StatusBar.NetworkController(  321): athens iconLevel=5 mInetCondition= 0 IS_CMCC=true

12-31 09:22:16.062 D/Bluetooth HS/HF(  421): [BT][HFG] [API] mStateReceiver.onReceive(android.intent.action.SIG_STR)

12-31 09:22:16.062 D/Bluetooth HS/HF(  421): [BT][HFG] [API] mHandler.handleMessage(10)

12-31 09:22:16.062 D/TelephonyManager(  321): getDefaultSim is sim1

12-31 09:22:16.062 D/StatusBar.NetworkController(  321): refreshViews(): mDataConnected = false mDataActivity = 0.

12-31 09:22:16.197 I/System.out(23725): [CDS]close[33520]

12-31 09:22:16.197 I/System.out(23725): close [socket][/0.0.0.0:33520]

12-31 09:22:16.198 E/Corona  (23725): ERROR: Received authentication challenge is null

12-31 09:22:16.199 W/System.err(23725): java.io.IOException: Received authentication challenge is null

12-31 09:22:16.200 W/System.err(23725): at libcore.net.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:404)

12-31 09:22:16.200 W/System.err(23725): at libcore.net.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:352)

12-31 09:22:16.200 W/System.err(23725): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)

12-31 09:22:16.200 W/System.err(23725): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)

12-31 09:22:16.201 W/System.err(23725): at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1396)

12-31 09:22:16.201 W/System.err(23725): at java.lang.Thread.run(Thread.java:856)

12-31 09:22:16.201 D/dalvikvm(23725): threadid=16: exiting

12-31 09:22:16.201 D/dalvikvm(23725): threadid=16: bye!

12-31 09:22:16.201 D/dalvikvm(23725): threadid=0: freeing

12-31 09:22:16.210 I/Corona  (23725): nil

12-31 09:22:16.210 I/Corona  (23725): true

12-31 09:22:16.210 I/Corona  (23725): -1

Can you print out the value of “uri”?

01-01 08:42:30.883 I/Corona  (26880): getInfo

01-01 08:42:30.883 I/Corona  (26880): uri:http://internal.twirllook.com/v1/users/info

01-01 08:42:30.883 I/Corona  (26880): params:{headers = table: 0x20c56b0, }

01-01 08:42:30.883 I/Corona  (26880): params.headers:{BP-Device-Type = “android”, BP-Device-UUID = “D5C116D7-091C-449B-9BB0-A5E27196BA5E”, BP-API-Key = “7b6d669945bcfefad24a4d555c062c53d7f92a575cd159141b3d1cc046527bb4a3d3e00af326f06f3bfc20c044b4853337bc70855700361ca4282dd64f3c137a”, BP-Device-Token = “”, }

0

ERROR: Received authentication challenge is null

is a message coming from the web service you’re trying to use and it’s saying it can’t authenticate you.  Since I know nothing about the service you are using and the website itself was pretty useless, all I can do is ask why the BP-Device-Token is an empty string?   Is the UDID what the service is expecting?  How are you getting that information?  How is the device type determined?  Are they looking for “android” or “Android”? 

Rob

I have confirmed that you point out already.

1.The above code works fine on ios.

2.Other requests works fine on android.

3.If there is no params, the same error occurs.

network.request(uri, "GET", defaultEventListener)--, params)

01-01 11:29:26.197 I/Corona  (28484): getInfo

01-01 11:29:26.197 I/Corona  (28484): uri:http://internal.twirllook.com/v1/users/info

01-01 11:29:26.197 I/Corona  (28484): params:{headers = table: 0x20a1a60, }

01-01 11:29:26.197 I/Corona  (28484): params.headers:{}

01-01 11:29:26.198 D/dalvikvm(28484): threadid=15: interp stack at 0x58f63000

01-01 11:29:26.199 D/dalvikvm(28484): threadid=15: calling run()

01-01 11:29:26.200 I/System.out(28484): [socket][14] connection internal.twirllook.com/103.4.12.118:80;LocalPort=57854(30000)

01-01 11:29:26.200 I/System.out(28484): [CDS]connect[internal.twirllook.com/103.4.12.118:80] tm:30

01-01 11:29:26.201 E/Posix   (28484): [CDS]Libcore_io_Posix-throwErrnoException, functionName: connect; errno: Operation now in progress

01-01 11:29:26.201 D/Posix   (28484): [Posix_connect Debug]Process jp.co.bluepay.wallets :80 

01-01 11:29:26.318 I/System.out(28484): [socket][/192.168.19.113:57854]

01-01 11:29:26.318 I/System.out(28484): rx timeout:30000

01-01 11:29:26.478 I/System.out(28484): [CDS]close[57854]

01-01 11:29:26.478 I/System.out(28484): close [socket][/0.0.0.0:57854]

01-01 11:29:26.479 E/Corona  (28484): ERROR: Received authentication challenge is null

01-01 11:29:26.479 W/System.err(28484): java.io.IOException: Received authentication challenge is null

01-01 11:29:26.480 W/System.err(28484): at libcore.net.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:404)

01-01 11:29:26.480 W/System.err(28484): at libcore.net.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:352)

01-01 11:29:26.480 W/System.err(28484): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)

01-01 11:29:26.480 W/System.err(28484): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)

01-01 11:29:26.480 W/System.err(28484): at network.NetworkRequest$AsyncNetworkRequestRunnable.run(NetworkRequest.java:1396)

01-01 11:29:26.480 W/System.err(28484): at java.lang.Thread.run(Thread.java:856)

4.When using a web browser, the response is correct.

url:

http://internal.twirllook.com/v1/users/info

response:

{“result”:false,“code”:-1}

Right, that’s why I’m looking at things that would be different than iOS.  That would be the string “android” vs. whatever it sends on iOS, the UDID and the empty device token.  Is it empty on iOS?

Can you contact the API provider and ask what things generate that specific error?  Perhaps they can do some logging on their end to figure out why you’re failing.   I don’t see anything in your URL or headers that would trigger known issue in Android.  Generally speaking iOS is more forgiving when the requests are not formatted correctly and Android is much more picky.

Rob

I think ‘GET’ network.request which has no params and a request from a webbrowser should be the same result. Is this wrong?

It all depends on the web script you’re calling’s requirements.  It might not run at all without params since it’s trying to log you in/authenticate you.

OK.Thanks Rob.

I fixed a code as save ‘Set-Cookie’ of responseHeader in network.request eventlistener callback,and set it to ‘Cookie’ of header when execute the next network.request. As a result, a request succeeded.

The following is a code.

local Bluepay = { APIKEY\_BLUE = "7b6d669945bcfefad24a4d555c062c53d7f92a575cd159141b3d1cc046527bb4a3d3e00af326f06f3bfc20c044b4853337bc70855700361ca 4282dd64f3c137a", URLH\_INTERNAL = "http://bluepay-internal\_api.", URLENDPOINT = "twirllook.com", URLH\_CONFIG = "http://wallets-static.s3.amazonaws.com/config/", URL\_INTERNAL\_API = nil, completed\_0 = nil, completed\_n = nil, errorOccured = nil, setCookie = nil, } local function defaultEventListener(event) print(event.response) print(event.isError) print(event.status) local errorFlag = 0 if true == event.isError then errorFlag = 1 end local decoded = nil if nil == event.response then errorFlag = 1 else decoded = json.decode(event.response) if nil ~= event.responseHeaders then local resCookie = event.responseHeaders['Set-Cookie'] print("response.coockie:"..resCookie) Bluepay.setCookie = resCookie end end event.decoded = decoded if nil == decoded then errorFlag = 1 else if false == decoded.result then errorFlag = 1 end end local completed\_0 = Bluepay.completed\_0 local completed\_n = Bluepay.completed\_n local errorOccured = Bluepay.errorOccured Bluepay.completed\_0 = nil Bluepay.completed\_n = nil Bluepay.errorOccured = nil if 0 == errorFlag then if 0 == decoded.code then if nil ~= completed\_0 then completed\_0(event) end else if nil ~= completed\_n then completed\_n(event) end end else if nil ~= errorOccured then errorOccured(event) end end end function Bluepay:getInfo(uuid, deviceToken, deviceType, completed\_0, completed\_n, erroccured) if nil ~= Bluepay.completed\_0 or nil ~= Bluepay.completed\_n then print("called Bluepay:function already.") return end Bluepay.completed\_0 = completed\_0 Bluepay.completed\_n = completed\_n Bluepay.errorOccured = erroccured local api = "/v1/users/info" local uri = (nil ~= Bluepay.URL\_INTERNAL\_API and Bluepay.URL\_INTERNAL\_API or (Bluepay.URLH\_INTERNAL..Bluepay.URLENDPOINT))..api local params = {headers={}} params.body = nil params.headers["Blue-Device-Type"] = deviceType params.headers["Blue-Device-Token"] = deviceToken params.headers["Blue-API-Key"] = Bluepay.APIKEY\_BLUE params.headers["Blue-Device-UUID"] = uuid params.headers["Cookie"] = Bluepay.setCookie print("getInfo") print("uri:"..uri) print("params:"..dumpdata:dump(params)) print("params.headers:"..dumpdata:dump(params.headers)) network.request(uri, "GET", defaultEventListener, params) end

The following is a log.

01-05 15:18:18.159 I/Corona  ( 9407): 

response.coockie:laravel_session=eyJpdiI6ImMxajRCR3F2b01lUytyb3Rjc0VwSEE9PSIsInZhbHVlIjoiZ2FDejBEZFl2YUVYOEtQTmFJM

UV4b2hqcjk2d00xY2FrSk9tekdCRDZYNmR2VGlnbUZPeXhpWmtvQTVZciszcDMrcTVySXAxZDFIT1J1cXpvNUJsUWc9PSIsIm1hYyI6ImQ4OTg1ZTB

lMWM3MzkxY2JlNmY5NTZkMWVlN2NiNGQ4MDFlNjZkMzUzMmE3NDcwMzgxODJiNjEyYzI2ZGY2MTYifQ%3D%3D; expires=Mon, 05-Jan-2015 

09:19:22 GMT; Max-Age=7200; path=/; domain=internal.twirllook.com; httponly

01-05 15:18:18.159 I/Corona  ( 9407): getInfo

01-05 15:18:18.160 I/Corona  ( 9407): uri:http://internal.twirllook.com/v1/users/info

01-05 15:18:18.160 I/Corona  ( 9407): params:{headers = table: 0x1fb79a8, }

01-05 15:18:18.160 I/Corona  ( 9407): params.headers:{Blue-API-Key = 

"7b6d669945bcfefad24a4d555c062c53d7f92a575cd159141b3d1cc046527bb4a3d3e00af326f06f3bfc20c044b4853337bc70855700361ca

4282dd64f3c137a", Blue-Device-Type = “android”, Blue-Device-UUID = “928FCB6A-95ED-4867-B666-E299C40EFE31”, Cookie 

"laravel_session=eyJpdiI6ImMxajRCR3F2b01lUytyb3Rjc0VwSEE9PSIsInZhbHVlIjoiZ2FDejBEZFl2YUVYOEtQTmFJMUV4b2hqcjk2d00xY

2FrSk9tekdCRDZYNmR2VGlnbUZPeXhpWmtvQTVZciszcDMrcTVySXAxZDFIT1J1cXpvNUJsUWc9PSIsIm1hYyI6ImQ4OTg1ZTBlMWM3MzkxY2JlNmY

5NTZkMWVlN2NiNGQ4MDFlNjZkMzUzMmE3NDcwMzgxODJiNjEyYzI2ZGY2MTYifQ%3D%3D; expires=Mon, 05-Jan-2015 09:19:22 GMT; 

Max-Age=7200; path=/; domain=internal.twirllook.com; httponly", Blue-Device-Token = 

"APA91bGSGVFCJG0MLAW19JPQgVyUqDvQxfPC60bnLxHGK6xFSybebhDJlMCA4USkyOgxpHr6_dWQwUiXSttbechHda3ZvUdvk1Dp1UtFpAAE1S98t

YYetu_wB3JPuB7O8NrmbHxZmqp16V8gsq9EjiVWfGiQMtsQaQ", }

01-05 15:18:18.163 D/dalvikvm( 9407): threadid=16: interp stack at 0x5c973000

01-05 15:18:18.163 D/dalvikvm( 9407): threadid=16: calling run()

01-05 15:18:18.164 I/System.out( 9407): [socket][37] connection 

internal.twirllook.com/103.4.12.118:80;LocalPort=44453(30000)

01-05 15:18:18.164 I/System.out( 9407): [CDS]connect[internal.twirllook.com/103.4.12.118:80] tm:30

01-05 15:18:18.165 E/Posix   ( 9407): [CDS]Libcore_io_Posix-throwErrnoException, functionName: connect; errno: 

Operation now in progress

01-05 15:18:18.166 D/Posix   ( 9407): [Posix_connect Debug]Process jp.co.bluepay.wallets :80 

01-05 15:18:18.192 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.193 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.256 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.257 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.270 V/ActivityManager(  238): getTasks: max=3, flags=0, receiver=null

01-05 15:18:18.270 V/ActivityManager(  238): jp.co.bluepay.wallets/com.ansca.corona.CoronaActivity: 

task=TaskRecord{4182b8f0 #36 A jp.co.bluepay.wallets}

01-05 15:18:18.270 V/ActivityManager(  238): com.anddoes.launcher/.Launcher: task=TaskRecord{4163b7c0 #2

com.anddoes.launcher}

01-05 15:18:18.271 V/ActivityManager(  238): com.android.settings/.SubSettings: task=TaskRecord{41952e40 #7

com.android.settings}

01-05 15:18:18.271 V/ActivityManager(  238): com.android.settings/.SubSettings: task=TaskRecord{41952e40 #7

com.android.settings}

01-05 15:18:18.271 V/ActivityManager(  238): com.android.settings/.Settings: task=TaskRecord{41952e40 #7

com.android.settings}

01-05 15:18:18.271 V/ActivityManager(  238): We have pending thumbnails: null

01-05 15:18:18.272 V/ActivityManager(  238): getTasks: max=3, flags=0, receiver=null

01-05 15:18:18.272 V/ActivityManager(  238): jp.co.bluepay.wallets/com.ansca.corona.CoronaActivity: 

task=TaskRecord{4182b8f0 #36 A jp.co.bluepay.wallets}

01-05 15:18:18.272 V/ActivityManager(  238): com.anddoes.launcher/.Launcher: task=TaskRecord{4163b7c0 #2

com.anddoes.launcher}

01-05 15:18:18.272 V/ActivityManager(  238): com.android.settings/.SubSettings: task=TaskRecord{41952e40 #7

com.android.settings}

01-05 15:18:18.272 V/ActivityManager(  238): com.android.settings/.SubSettings: task=TaskRecord{41952e40 #7

com.android.settings}

01-05 15:18:18.272 V/ActivityManager(  238): com.android.settings/.Settings: task=TaskRecord{41952e40 #7

com.android.settings}

01-05 15:18:18.272 V/ActivityManager(  238): We have pending thumbnails: null

01-05 15:18:18.320 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.321 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.384 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.385 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.450 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.450 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.514 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.514 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.523 I/SurfaceFlinger(  100): [SurfaceFlinger] frames:17, duration:1.029000, fps:16.518656

01-05 15:18:18.579 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.579 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.613 I/System.out( 9407): [socket][/192.168.17.23:44453]

01-05 15:18:18.613 I/System.out( 9407): rx timeout:30000

01-05 15:18:18.645 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.645 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.709 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.709 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.774 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.776 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.838 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.839 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.845 D/StateMachine(  238): handleMessage: E msg.what=131155

01-05 15:18:18.845 D/StateMachine(  238): processMsg: ConnectedState

01-05 15:18:18.845 D/WifiStateMachine(  238): ConnectedState{ what=131155 when=-1ms arg1=22 }

01-05 15:18:18.845 D/WifiCommon(  238): [wlan0] Issue cmd = ‘SIGNAL_POLL’

01-05 15:18:18.846 D/wpa_supplicant(  450): CMD = SIGNAL_POLL

01-05 15:18:18.846 D/wpa_supplicant(  450): wpa_driver_signal_poll

01-05 15:18:18.847 I/WifiStateMachine(  238): fetchRssiAndLinkSpeedNative, newRssi=-54

01-05 15:18:18.847 D/StateMachine(  238): handleMessage: X

01-05 15:18:18.903 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.903 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.967 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:18.967 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:19.031 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:19.031 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:19.095 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:19.096 I/SurfaceView( 9407): Changes: creating=false format=false size=false visible=false left=false 

top=false mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceVisibilityChanged=false 

forceSizeChanged=false mVisible=true mRequestedVisible=true

01-05 15:18:19.144 I/System.out( 9407): [CDS]close[44453]

01-05 15:18:19.145 I/System.out( 9407): close [socket][/0.0.0.0:44453]

01-05 15:18:19.146 D/dalvikvm( 9407): threadid=16: exiting

01-05 15:18:19.146 D/dalvikvm( 9407): threadid=16: bye!

01-05 15:18:19.146 D/dalvikvm( 9407): threadid=0: freeing

01-05 15:18:19.158 I/Corona  ( 9407): {“result”:true,“code”:0,“errmsg”:"",“errtitle”:"",“info”:

{“FirstName”:“r”,“LastName”:“n”,“Tel”:“03-5843-1151”,“Birth”:“1969-03-29”,“Sex”:1}}

01-05 15:18:19.158 I/Corona  ( 9407): false

01-05 15:18:19.158 I/Corona  ( 9407): 200

Why isn’t cookie set automatically in android?

Do I have to manage cookie manually in the application?

This problem seems related to this topic.

http://forums.coronalabs.com/topic/53519-lost-session-on-android-how-to-manage-cookies/

But it isn’t a good way.

How should I do for cookie to be managed automatically like ios?

anyone have any idea?

I’ve asked Engineering…

is there any news about this issue?

According to Engineering, Android does not cache cookies to a file by default like Apple does.  Cookies are only cached to memory and will be lost when the app restarts.  You would need to manage this yourself. 

Android also does not share cookies between network.request and webViews either. 

Rob

Rob,

Ah…just as I thought I was. I’ll give it a try.

Thanks.