Session variables and cookies seem very similar to me. I understand the technical differences, but how do you decide when to use one vs. the other?
Your definite Guide
N.B - A cookie is stored on users' browsers, and a session is stored on your hosting server machine.
When to Use
Use a cookie when you want your application to remember user's data always, even when they have closed their browsers. E.g whenever you type www.facebook.com it takes you to your account, even when your browser has been closed and re-opened.
Because any data kept in a session is cleared off once you close your browser.
Use a cookie when the user information to be stored is much larger than normal. ... With a session, if you have a larger user base, like Facebook, think of how it will look storing all user sessions on the hosting machine.
Use a session when the user information to be stored is not larger than normal, and you don't want the public to have access to your user variables...