Home » Php » java – What is called session store?

java – What is called session store?

Posted by: admin July 12, 2020 Leave a comment

Questions:

What is called session store in context of web applications/websites ?

Is it anything more than a temporary store of session variables?

How to&Answers:

Typically the user’s first request to the site establishes a session. The session has a key which is passed to the user as a cookie, so that with every subsequent request the same session is retrieved.

The session store can store information about that user you don’t want (or can’t due to the length limit of cookies) to put in a cookie, for example the currently logged-in user ID or the contents of a shopping cart. This is usually in the form of some kind of serialized data structure depending upon the language/framework in use.

The reason why you might implement the session store in an external database rather than within the local web server would be to account for if you have multiple web servers in a pool; this way if the user’s first request went to server A, and the next went to server B, your web app can still retrieve the same session data every time.