SESSION ID FOR EVERY LOGIN IN ASP.NET MVC?

Jayden Bell

Total Post:110

Points:774
Posted by  Jayden Bell
 3678  View(s)
Ratings:
Rate this:
I am new to MVC, I want to get new sessionId for everylogin, for that i am getting like

string sessionId = HttpContext.Current.Session.SessionID;

But, it is generating same sessionid for every login.

I have used to remove or clear session like below:

Session.Abandon();
Session.RemoveAll();
Session.Clear();

But there is no change in generating sessionid for every login. Is there any alternative to create new sessionId for every login?

  1. Mark Devid

    Post:102

    Points:714
    Re: Session Id for every Login in Asp.net MVC?

    I got better solution to create new session id like


    SessionIDManager manager = new SessionIDManager();
    string newSessionId = manager.CreateSessionID(HttpContext.Current);

      Modified On Apr-06-2018 01:18:32 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!