Click here to Skip to main content
15,887,946 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using session for login from customer table and I want to know how to write a code for logout..
Posted
Updated 23-Jun-13 7:55am
v3
Comments
Shahin Khorshidnia 23-Jun-13 13:55pm    
You should tag your question. For example ASP.Net

Session.Abandon(): destroys the session and the Session_OnEnd event is triggered.

Session.Clear(): just removes all values (content) from the Object. The session with the same key is still alive.

Source: http://stackoverflow.com/a/347382[^]

[Edit]Reference to original source added and unnecessary code block formatting removed[/Edit]
 
Share this answer
 
v2
Comments
Thomas Daniels 23-Jun-13 9:10am    
If you copy a solution from another site, please provide always a reference to the original solution.
We can't tell you exactly how to do it, because we have no idea what mechanism you are using for login - much less what environment you are working in. If it is Web based, then login / logout is best handled by using Membership: MSDN: Introduction to Membership[^], and if you are using that you should already known how to log out, or it is explained in the documents.

If you are in Winforms, then you have presumably "brewed your own" login system, so we have no idea at all what help you need.
 
Share this answer
 
Comments
Alok.singh1166 23-Jun-13 6:07am    
That is a web application and i used session for login from customer table..

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