Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are session variables stored in Rails?

Tags:

hard disk, main memory or somewhere else. I am not asking for the case where these are stored in database.

like image 715
rubyprince Avatar asked Sep 06 '11 10:09

rubyprince


People also ask

Where is session stored?

A session is a global variable stored on the server. Each session is assigned a unique id which is used to retrieve stored values. Whenever a session is created, a cookie containing the unique session id is stored on the user's computer and returned with every request to the server.

How does session work in Rails?

Rails provides a session object for each user that accesses the application. If the user already has an active session, Rails uses the existing session. Otherwise a new session is created. Read more about sessions and how to use them in Action Controller Overview Guide.

What can be stored in session variable?

Session variables are a way to store data about a user in a database and retrieve it later. Cookies are a way to store data about a user on the user's computer. Session variables are typically used in applications that need to keep track of a user's activity.

What are session variables?

A session variable is a special type of variable whose value is maintained across subsequent web pages. With session variables, user-specific data can be preserved from page to page delivering customized content as the user interacts with the web application.


1 Answers

By default rails uses cookies to store the session data. All data is stored in the client, not on the server.

like image 144
wanderfalke Avatar answered Oct 04 '22 16:10

wanderfalke