RPB
RPB

Reputation: 16330

Which is the best way to keep session alive?

We use keep me logged in or Remember me option to be logged in to application 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

Upvotes: 0

Views: 3516

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038860

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.

Upvotes: 1

Amir
Amir

Reputation: 820

The best way is to keep cookie in browser,but encrypted.

I use this way.It's good.

Upvotes: 0

Related Questions