-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to store the needed session data in localStroage instead of a cookie? #423
Comments
This is more of an Engine.IO question if you ask me. I'm working on the same thing right now. In short, Engine.IO uses document.cookie, which in a Hybrid or web situation would have been populated with the Connect session. But in a stand-alone PhoneGap app, this document.cookie should be pre-populated in advance (and stored in local storage), instead of being left blank. Apparently, the more mature SockJS-client does something equivalent. |
@drauschenbach So do you think switching the transport to use sock.js would solve the problem?
|
I've just solved this on my end by avoiding the issue altogether... I switched my app to Hybrid by telling PhoneGap to download an external http URL instead of an embedded one. SockJS is worth a try, but you also need to turn on storage of cookies for file:// URLs so that the cookies get saved between mobile app sessions. |
@drauschenbach I tell phonegap to pull from a remote url as well, but I still hit this problem. You're using socketstream/phonegap and are getting session cookies persist between full app restarts? |
Well not exactly. My web app (PhoneGap or otherwise) uses session-scoped cookies. I do this because I don’t implement a global RPC error trap yet, which would have to reload the page as soon as my RPC functions start returning 403 due to the session having been expired by Redis on the server while the client Ember app continues to run. On Jan 9, 2014, at 2:31 PM, mooglin notifications@github.com wrote:
|
@drauschenbach Ok, I guess I will look into sock.js and see if that solves the issue. @paulbjensen If you come across any details that would help please pass them along. Thanks! |
Simply switching to sock.js did not change anything. I will keep looking into it, thanks for any help. |
I believe that @kulicuu is looking into this issue, is that right? |
Yes, although only generally at this point. The engine.io migration turned out not to require such a major change. |
@drauschenbach I will be fixing this in the coming weeks for Is there a documentation page for PhoneGap behavior on cookies/local storage |
I'm trying to use socketstream with phonegap. The session becomes lost when the app is restarted, the cookie does not persist. I was thinking I could store the needed data in localStroage because that does seem to persist.
Is this possible? What data needs to be stored/updated?
The goal is autologin / persistent login between app restarts, not just page reloads, which already works.
The text was updated successfully, but these errors were encountered: