Jump to content

Recommended Posts

How secure are session variables? Ff I had a user successfully login and then created $_SESSION['username'] = $username; variable, would this be safe practice? Is it possible that somebody could get into the session variable and change it? This question is especially important for changing passwords where the username should be remembered server-side for quick database reference. Any comments would be appreciated, thanks a bunch.

- Mark

You should do fine with that. If you store something like the username or user ID in the session then changing the password would not be a problem in respect to remaining logged in. Don't store the password, you wont need it so there is no point in it.

 

However, there are a few aspects you must consider with session security so I would suggest you to read page 7 of my tutorial "PHP Security" which I recently published here.

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.