Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:24:35+00:00 2026-06-03T20:24:35+00:00

If (for argument sake) ‘admin-access’ was granted in php with: if (isset($_SESSION[‘admin’])) // this

  • 0

If (for argument sake) ‘admin-access’ was granted in php with:

if (isset($_SESSION['admin']))  // this session would be set
{ // grant access; }            // after a successful login
else { //redirect ;}

Would this be a particularly easy thing to bypass and fake, if you knew what the name of the session is (in this case it is admin)?

In other words, can someone easily fake a $_SESSION, if all a script calls for is the session to be ‘set’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:24:38+00:00Added an answer on June 3, 2026 at 8:24 pm

    Using isset() is not bad for security. It depends on your logic that how you use it. It will be good if you not only check isset() but also its value.

    For Example:

    if( isset($_SESSION['admin']) && $_SESSION['admin'] == true ) { 
      // grant access
    } else { 
      //redirect 
    }
    

    Or something like this:

    if( isset($_SESSION['admin']) && $_SESSION['admin'] == '1' ) { 
      // grant access
    } else { 
      //redirect 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my markup like this (for argument's sake) <div id=content></div> <div id=layout></div> <div
For sake of argument, how could I do this in VB? foreach foo in
Ok, I have a set of checkboxes for selecting criteria. For argument's sake, we'll
For the sake of argument, here's a simple person class public class Person :
For argument's sake lets assume a HTML parser. I've read that it tokenizes everything
I would prefer if those who answer this question state whether or not they
For the sake of argument, let's say I'm implementing Future for a task which
For the sake of argument, consider a UI thread as a thread that has
For the sake of argument I have Person Objects public class Person { public
For the sake of argument assume that I have a webform that allows a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.