Home > DeveloperSection > Forums > Session Id for every Login in Asp.net MVC?
Jayden Bell
Jayden Bell

Total Post:105

Points:739
Posted on    October-27-2014 1:27 AM

 ASP.Net Session  Session Timeout  Sessionid 
Ratings:


 1 Reply(s)
 1401  View(s)
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 genereating sessionid for every login. Is there any alternative to create new sessionId for every login?



Mark Devid
Mark Devid

Total Post:101

Points:707
Posted on    October-27-2014 1:29 AM

I got better solution to create new session id like

SessionIDManager manager = new SessionIDManager();

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


Don't want to miss updates? Please click the below button!

Follow MindStick