Jump to content

Recommended Posts

Would you Put powerful data in a session as a means of authorisation..

 

 

For example, I have a script that queries the users username and see's if there member group is about 3

 

If it is I know they are a moderator

 

however, would be much easier to jsut have a session with the data moderator=yes inside it for example

 

Is there anyway that can be taken advantage of by a malicious user?

 

From what I know sessions are really secure as they are stored server side but would it be something you would try and avoid or is it something ok to go ahead with?

Link to comment
https://forums.phpfreaks.com/topic/70645-sessions-power/
Share on other sites

I tend to limit the amount of data in my sessions to the username / id and if they're logged in or not.  I don't think there's any extra security gained from this, but it allows me to only have to worry about updating information in one place.

 

Here's a hypothetical situation for you.  You have an admin user that is abusing their privileges.  The super-user logs in and demotes them to non-admin.  Now, if each page load is reading the user's status from the DB then they immediately lose their privileges.  If you have their role / status stored in a session then it won't take affect until they log out, which means they can continuously abuse their privileges even though the super-user has revoked them.

Link to comment
https://forums.phpfreaks.com/topic/70645-sessions-power/#findComment-355062
Share on other sites

Yeh I was just thinking that, unless I removed there session file from the server?

 

How can you locate a users session if I have root access. Any idea..

 

I suppose one why would be to put the session ID in there database row.. maybe an easier way?

Link to comment
https://forums.phpfreaks.com/topic/70645-sessions-power/#findComment-355065
Share on other sites

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.