Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Session["UserName"] = txtuser.Text.ToString().Trim();
Session["StudName"] = TxtName.Text.ToString().Trim();
Session["StudID"] = TxtStudID.Text.ToString().Trim();

I know how to remove sessions using Session.clear().

But I want to remove the session "UserName" only.

How do I remove a specific session?


for that how can id so using asp.net with csharp.

Please help me.

Regards,
Narasiman P.
Posted
Comments
Amir Mahfoozi 7-May-13 0:43am    
Have you tried Google ?

http://forums.asp.net/t/993140.aspx/1

Use Session.Remove("UserName");
 
Share this answer
 
Use Session.Remove("UserName") to remove key from Session.
 
Share this answer
 
Try this my friend.
Session.Remove("Session Name");
 
Share this answer
 
Session.Remove("UserName");
This works, I have always used this!
 
Share this answer
 

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