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

  • SEARCH
  • Home
  • 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 7972359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:50:34+00:00 2026-06-04T07:50:34+00:00

My question is about this summary on session fixation: Alice has an account at

  • 0

My question is about this summary on session fixation:

  • Alice has an account at the bank http://unsafe.com/. Unfortunately, Alice
    is not very security savvy.

  • Mallory is out to get Alice’s money from the bank.

  • Alice has a reasonable level of trust in Mallory, and will visit
    links Mallory sends her.

    1. Mallory has determined that http://unsafe.com/ accepts any session
      identifier, accepts session identifiers from query strings and has
      no security validation. http://unsafe.com/ is thus not secure.
    2. Mallory sends Alice an e-mail: “Hey, check this out, there is a cool new
      account summary feature on our
      bank,http://unsafe.com/?SID=I_WILL_KNOW_THE_SID”. Mallory is trying to
      fixate the SID to I_WILL_KNOW_THE_SID.
    3. Alice is interested and
      visits http://unsafe.com/?SID=I_WILL_KNOW_THE_SID. The usual log-on
      screen pops up, and Alice logs on.
    4. Mallory visits http://unsafe.com/?SID=I_WILL_KNOW_THE_SID and now has unlimited access
      to Alice’s account. (credit: RichieHindle)

Questions:

Q1 – Is there a way to explicitly prevent the site from accepting any
session identifier?

Q2 – I don’t use the $_GET variable on my site so is there a way to prevent accepting session identifiers from query strings?

  • Notes: I’m using php 5.4.3 with SSL and will also use session_regenerate_id..
  • 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-04T07:50:36+00:00Added an answer on June 4, 2026 at 7:50 am

    You could set the options martinstoeckli mentioned in his answer, but this won’t prevent session fixation. It makes session fixation a little harder to attack, but it doesn’t prevent it.

    As ServerBloke mentioned, you prevent session fixation by using session_regenerate_id() immediately after verifying the user’s login information and before you show the first page that requires authentication.

    Making it harder for the attacker to exploit session fixation does not prevent session fixation. You must generate a new session ID.

    More and more, people are using public unsecured untrusted wi-fi hot spots. Sessions can be sniffed from the air. On a physical network, they can be sniffed off the wire. They can also force you to visit any URL by employing a man-in-the-middle attack. So, session fixation is still a problem, even if the attacker can’t send you URLs.

    Knowing that sessions (and passwords) can be sniffed, there is another step that is required to prevent session hijacking. That is HTTPS (TLS/SSL).

    All protected pages that require authentication should be accessed only over HTTPS. So, the login page (the one where the user sends their username and password) should be accessed via HTTPs. In that same script, you must regenerate a new sessionID. All pages for the remainder of the session must then be accessed via HTTPs to protect the new session ID.

    Here’s an example pseudocode login.php script:

    // Force SSL
    if($_SERVER["HTTPS"] != "on") {
      die('Must login via HTTPS');
    }
    
    // Load the current sessionID
    session_start();
    
    // Validate the login information, being sure to escape the input
    ...
    if (! $valid) {
      die('Invalid login');
    }
    
    // Start the new session ID to prevent session fixation
    session_regenerate_id();
    
    // Clear the old session
    $_SESSION=array();
    
    // Log them in
    $_SESSION['user_id'] = $userID;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already posted a question about this, but the situation has changed sufficiently
This is not the same old question about the validators and update panel compatibility.
What This Question Is Not About This question is not about how to auto-close
I have a question about this formula from a book: EFW (cm,kg)= 10^(-1,7492+(0,166*BPD)+(0,046*AC)-(2,646*AC*BPD/1000)) The
I see a question about this here . However, in my case, It is
nobody loved my first question about this: Creating Entity Framework objects with Unity for
Hi I have a question about this pointer, when an object is constructed, when
I got a few question about this IDE. First, when boot up vs2010, it
So I just have posted a question about this code (which was answered): $(document).ready(Main);
I have a question about my C++ homework. I am just confused about *this.

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.