fletchsod
Programmer
- Dec 16, 2002
- 181
I'm having a problem on creating a seperate session for every login.
When you fire up a web-browser, then you opened two tab-windows where the 1st tab-window is for customer login and the 2nd tab-window is for admin login.
Problem is when you made a login (customer) on the 1st tab-window to browse around and use the 2nd tab-window to login (admin). Then you do a logout (customer) on the 1st tab-window (which did a session.abandon() and later browse the admin area on the 2nd tab-window, I encountered an expired session.
This tell me that the web browser is sharing the session identifier. So, I want to make a seperate session and seperate session identifier for every login (customer or admin) so they remain independent of each other via tab-window.
How do you guys accomplish this in ASP.NET? This script I tried doesn't work as I got the null session when logging in.
Thanks...
When you fire up a web-browser, then you opened two tab-windows where the 1st tab-window is for customer login and the 2nd tab-window is for admin login.
Problem is when you made a login (customer) on the 1st tab-window to browse around and use the 2nd tab-window to login (admin). Then you do a logout (customer) on the 1st tab-window (which did a session.abandon() and later browse the admin area on the 2nd tab-window, I encountered an expired session.
This tell me that the web browser is sharing the session identifier. So, I want to make a seperate session and seperate session identifier for every login (customer or admin) so they remain independent of each other via tab-window.
How do you guys accomplish this in ASP.NET? This script I tried doesn't work as I got the null session when logging in.
Code:
System.Web.SessionState.SessionIDManager oSessionIdManager = new System.Web.SessionState.SessionIDManager();
string sNewSessionId = oSessionIdManager.CreateSessionID(HttpContext.Current);
bool bRedirected = false;
bool bCookieAdded = true;
oSessionIdManager.SaveSessionID(HttpContext.Current, sNewSessionId, out bRedirected, out bCookieAdded);
Thanks...