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 6859247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:15:34+00:00 2026-05-27T02:15:34+00:00

So I’m running into an interesting issue implementing session ID rolling after log-in/change of

  • 0

So I’m running into an interesting issue implementing session ID rolling after log-in/change of access levels/etc.

On log-in I’m currently trying to generate a new session ID using the SessionIDManager, however this only changes the cookie header, it doesn’t swap out the session in HttpContext, so as I add additional details to the session (various details to bind the user to the session ID), they immediately get lost (not to mention the old session gets abandoned).

To prevent session hijacking (by storing primary non-SSL communication) and session fixation, we should generate a new Session ID upon log in, but Microsoft doesn’t seem to allow you to do that (grr, so many read-only variables and sealed classes with no constructors). I could just migrate all data in the backend SQL, but that seems a bit “dirty hack”.

Any ideas on how to properly do this?

Edit:

Implementations I’ve found:

Session.Abandon();
Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));

Session still is the old session, so on next page, all changes are lost.

SessionIDManager doesn’t return a session object after SaveSessionID, so I cannot add details to the session I just created. On the next page load I can, but the old session is now inaccessible (and abandoned, but even if it wasn’t abandoned…).

HttpContext.Session is read only, even if it wasn’t, HttpSessionState doesn’t have a constructor.

Edit 2:

Session Fixation in ASP.NET

Apparently session fixation and hijacking have been talked about before here, with the answer being “Microsoft doesn’t seem to care”, with a poorly implemented two-phase fix.

  • 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-05-27T02:15:35+00:00Added an answer on May 27, 2026 at 2:15 am

    Alright, so this is a bit of an issue, showed how you can hijack session based auth AND forms based auth using this method (you’ll need a valid user account, but you can hijack someone else’s session), there are some blogs online that complain about session fixation and the ability to easily exploit hijacking. So obviously this is a huge issue. Yahia pointed out Microsoft isn’t interested in fixing this.

    What I did was create an authenticity key that got paired with the session ID, upon log in we’d generate a new one and put it in the session and give the user a cookie, if there was a key in the session they must match, if not we’d kick the user (hijacking attempt). It seems to be a common way to do this on the blogs mentioned (another is to use forms auth to basically encrypt the cookie, while this works fine I wanted the solution to be compatible with multiple types of authentication).


    One thing that was recommended that could help is to prevent any non-ssl communication by using another application as the non-ssl front end that just serves 302 redirects, as recommended by Yahia, while this helps a ton by preventing the disclosure of the session IDs in the first place, it would require a lot of restructuring of how the applications are deployed to fix, and IMO: .NET’s iffy session management should be fixed in the first place, and I wanted our applications to be fully secured from the ground up, not dependent on other applications to do 302 redirects so that any information leakage is irrelevant being as the cookie will rotate on log in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.