{ "id": "119505", "key": "TIMOB-15434", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-09-05T11:12:49.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "cookies", "httpclient" ], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [ { "id": "58634", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "151382", "key": "TIMOB-20075", "fields": { "summary": "Android: Titanium.Network.addSystemCookie not adding cookie to webview", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2020-08-18T20:42:48.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "On iOS any cookies set in HTTPClient sessions are kept until you or the server clears them. On Android though, they are cleared when you exit the app (not to the background, but really close it).\r\n\r\nh1. To reproduce\r\n\r\n# Create new app: {{titanium create -p ios,android -n testCookies -d . --id test.cookies}}\r\n# In {{app.js}} use:\r\n {code:javascript}\r\n Ti.API.debug('I was just opened, not resumed');\r\n\r\n var w = Ti.UI.createWindow({backgroundColor:'white'});\r\n var b = Ti.UI.createButton({top: 100, title:'Request'});\r\n var l = Ti.UI.createLabel({top: 200});\r\n\r\n b.addEventListener('click', function () {\r\n var client = Ti.Network.createHTTPClient({\r\n onload: function(e) {\r\n l.setText(this.responseText);\r\n }\r\n });\r\n client.open('GET', 'http://dev.fokkezb.nl/cookie.php');\r\n client.send();\r\n });\r\n\r\n w.add(b);\r\n w.add(l);\r\n\r\n w.open();\r\n {code}\r\n# Run the app on both iOS and Android\r\n# Click the *Request* button several times\r\n# Confirm that under the button the server response is a incrementing number\r\n# Force close the app\r\n# Open the app again and click the *Request* button\r\n# You'll see that on iOS the number picks up where it was, but on Android is starts at 1 again\r\n\r\nh1. Server code\r\n\r\nThe PHP code on the server is really simple:\r\n\r\n{code:php}\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Cookies are not preserved after closing the app", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK/CLI 3.1.2.GA\r\nAndroid 4.1.2 on Samsung Galaxy S2", "comment": { "comments": [ { "id": "270460", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "How did you close / killed the app in iOS?", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-09-09T22:20:19.000+0000", "updated": "2013-09-09T22:20:19.000+0000" }, { "id": "270648", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I closed the app on iOS (7) by:\n\n# Singletap on the home button to move it to background.\n# Doubletap on the home button to bring up the new multitasking screen.\n# Swipe the app screen up to close it.\n\nI've added a log call to the example code above so in the logs you can tell it's not resuming, but actually opening the app from scratch, still preserving the session and thus cookie.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-09-10T19:09:57.000+0000", "updated": "2013-09-10T19:09:57.000+0000" }, { "id": "325812", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces\r\n\r\nTitanium SDK version 3.4.0 master, 3.1.2.GA\r\nTitanium Studio, build: 3.3.0.201407100905\r\nTitanium Command-Line Interface\r\nCLI version 3.3.0, \r\nAndroid device : Motorola Moto G, Android version : 4.4.4", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-26T07:33:25.000+0000", "updated": "2014-09-26T07:33:25.000+0000" }, { "id": "398817", "author": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "body": "Any news on this issue?\r\n", "updateAuthor": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "created": "2016-10-13T09:20:43.000+0000", "updated": "2016-10-13T09:20:43.000+0000" }, { "id": "423122", "author": { "name": "nipoul", "key": "nipoul", "displayName": "Nikos Poulios", "active": true, "timeZone": "Europe/Berlin" }, "body": "I noticed that android get/addSystemCookie is not working on Android 6.1.0.GA. After some testing I found out that those functions were not working on previous versions either (5.4.1/6.0.4) but it was noticed now in 6.1.0.GA, because I suppose that cookies were auto synced with the webview and in 6.1.0.GA cookies are not available after you restart the app\r\n\r\nI also added this comment on TIMOB-20075. I see 3 related tickets all going back to older versions, I am not sure if this should be a new ticket for 6.1.0.GA", "updateAuthor": { "name": "nipoul", "key": "nipoul", "displayName": "Nikos Poulios", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-06-29T08:11:15.000+0000", "updated": "2017-06-29T08:11:15.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }