So, I think I have a basic idea, of what Cookies and Sessions are. Cookies are stored on the client, and Sessions are stored on the server. But what I would like to know is what is the advantage of using a session over a cookie? Is a session simply used to share data between pages?
Share
Sessions are a better idea when you don’t want the client to have the ability to mess with the data. For example using a session variable to store the User ID of the current user is alright. Using a cookie however is a huge security hole as a halfway clever person would be able to spoof other user ids and gain access to other accounts.