Click here to Skip to main content
16,011,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..
I have more then one session use.
And Some time remove session in other page.
So..
How to get current session use or current working session list..
Not SessionId...
Posted
Comments
Volynsky Alex 6-Sep-12 7:07am    
Hi Achal!
To access the Session you can read following article :
http://ase.tufts.edu/its/webDtAspDotNetSession.htm
Regards,
A.

C#
foreach(string i in Session.Contents)   //returns active session variables.
{
    //Session[i];
}
 
Share this answer
 
Try this:
C#
public static string TheSessionId() {
    HttpSessionState ss = HttpContext.Current.Session;
    HttpContext.Current.Session["test"] = "test";
    HttpContext.Current.Response.Write(ss.SessionID);
    return "ok";
}

Found it here[^]

Refer similar discussion:
How to get SessionID[^]
asp.net session example: how to get SessionID (session id) for the current client[^]
 
Share this answer
 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900