I am trying to solve a number of security issues on a rather large ASP.NET web application (C #). To prevent session-committed attacks, I would like to generate a new session identifier every time a user authenticates. However, I only want to generate a new session identifier without losing the rest of the session. After some research on this topic, I found a couple of working solutions:
Solution 1: Create a new SessionId in ASP.NET
This allows you to clear the session cookie manually by setting it to an empty line. However, this requires either a page refresh or the use of AJAX to ensure that the cookie is indeed deleted, which is not a really viable option in my particular case.
Solution 2: Create a new ASP.NET session in the current HTTPContext
I have implemented this approach and it works as expected. However, according to the original poster, this is not really what you can call an elegant solution. In addition, this post is several years old and I hope that there may be a better solution for now.
I would like to know if there are any alternatives for this that I have missed in my research, or if something like solution 2 is possible without manipulating the internal session management environments.
source share