You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If we didn't have cookies and sessions, what would happen?
Web users must agree to let cookies be saved for them, but, in general, it helps Web sites to serve users better. So user can visit pages without it.
What is a cookie?
Cookies are session token, user preferences, or anything else that the web site needs to keep track of you from one request to the next.
What's the difference between a cookie and a session?
The main difference between a session and a cookie is that session data is stored on the server, whereas cookies store data in the visitor's browser.
What's serialization and how does it come into play with sessions?
Serialization is the process of converting an object into a stream of bytes in order to store the object or transmit it to memory, a database, or a file
Why would we want to store a user id in a session?
For server to track a specific user for this session.
What is a flash? How long does a flash have before it expires?
Flash is a pop up message that is stored in Controller. It expires with each time controller being updated or called.
What syntax would I use to add a user_id key and value to the session?