Which is the best way to keep session alive?
We use keep me logged in
or Remember me
option to be logged in to ap开发者_如何学Cplication so to do that which is best way to achieve this feature?
Whether we have to keep cookie in browser for these or what? Which is the best way to achieve this in application
This will depend on how is the session handled on the server side. If it uses sliding expiration you could include some javascript on each page which will send a dummy AJAX request to the server at regular intervals to keep the session alive. If you want to keep the session even if the browser is closed then you need to use persistent cookies which are stored on the user computer rather than HTTP only cookies.
The best way is to keep cookie in browser,but encrypted.
I use this way.It's good.
精彩评论