Interviews3 answers
How to get new session_id and force session_start() to execute?
3 Answers
clear the session on logout execution use below line. hope its clears session value and id both
Session.RemoveAll();
HttpContext.Current.Session.Clear();
HttpContext.Current.Session.Abandon();
HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();
Session.Clear();
Session.Abandon();
Response.Cookies["ASP.NET_SessionId"].Value = string.Empty;
Response.Cookies["ASP.NET_SessionId"].Expires = DateTime.Now.AddMonths(-10);
harikesh dubeyPosted Mar 6, 2019, 11:47 PM EST
you can use Abandon method of session.
Naveen BishtPosted Nov 19, 2018, 1:37 AM EST
1) Close the existing browser window and then open new instance of same browser.
2) Open new instance of different browser.
3)Use cookie less session.
for this set cookieless="true" in web.config.
Hitanshi MehtaPosted Sep 30, 2018, 4:35 AM EDT

