A cookie can contain different data that is stored on the client browser with server specific information like user id and or user preferences.
What are Sessions?
Sessions are used to store information in the form of variables that can be used across different pages on the site.
Session variables last till the users browser is closed and are lost after that, so it is a perfect solution to load the information as session variables and use them across several pages. Some of the examples of these variables would be user name, preferred color and theme etc.
0 Comment(s)