Jump to content

Recommended Posts

If you can, I'd use sessions.  Sessions are far more secure than using cookies.  Cookies are for more permanent data, but are stored on the client-side.  Where sessions are global variables while the window is open and stored on the server-side which makes them more secure.

You can store whatever you like, as long as you feel comfortable with what you are checking when they come back.  It can be anything, even a code.  Usually its just 1 or 2 items, since once they are on your site, you can check their info in the DB for updated info.

 

Like if you were to store their Admin level in a cookie, what happens when you put them down to a normal user, if their cookie always says Admin, then they can get to places they shouldn't after you remove that access.

Use both, I would say.  Sessions are most commonly used with cookie's in combination.  The session is the data stored on the server and the cookie is stored on the user's machine.  Only by recieving the "matching" cookie to go with the session does session work.  You can use sessions on their own and pass the data via the url but that comes with it's own set of security problems.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.