Node.JS session without cookies

I tried, but I found out that iOS 5 does not accept cookies by default. I try many different things even when using Redis, but still cannot get a session to save more than one request.

Without cookies, what other session options do I have? I'm going to start a raw session module using Redis, where I just send my “session id” back and forth, but it looks like it can easily slow down.

+5
source share
2 answers

If you cannot force the client to support cookies, perhaps you can put some data in LocalStorage, and then report that it’s up to the server to connect to the session, and structure it as a one-page application.

It will look something like this:

server                            |         client
send initial payload, with token  -->       store token in LocalStorage
initial payload contains some script

                                 <-- XHR request for /data?sessid=XXXXX
look up session, do stuff        -->  handle result, update DOM, do more XHR  

Are network sockets supported? You can use Socket.io for porting, which will be much less latency.

+5
source

, cookie. url , - , , URL-. , , . , iOS cookie. , , , ?

+2

All Articles