My site needs a way to know whether a user is an admin or not in multiple pages. So is it safe to store whether a user is an admin or not in session variable? Or is there a better alternative (Maybe another superglobal variable?), It will only hold a number.
Jump to Post
Yes, I would say it's safe, well, safer than using something like a cookie (Because a SESSION is server side). You could also store the users IP (or other validation checks) which are then checked everytime the data is then used. This could be one option. Also destroy the …
All 3 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.