Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Friends need code for logging out.
Posted

Hi,

place this code in your logout button click event

C#
session.abandon();


All the Best
 
Share this answer
 
Comments
Asad_Iqbal 21-Sep-11 4:43am    
Your code works thanks for your answer.
Try this code ...

C#
Session.Clear();
Session.Abandon();


Happy coding....
 
Share this answer
 
Comments
Asad_Iqbal 21-Sep-11 4:43am    
So nice of u friend Thanks.
Using asp.net? this would be nearly impossible because you normally don't have authorization to do that. You could run your asp.net with more authorization but this would be a major security risk.

I cannot imagine you would mean to log out clients because that is certainly impossible.

Good luck!
 
Share this answer
 
Comments
Asad_Iqbal 20-Sep-11 14:12pm    
Friend i don't want to logout client all i want is when clients wants to logout and click on logout he gets out, same as yahoo, facebook. i want code for my site so that when client sign in and finished with his work he could logout simple. but don't know the code please help me with it.
E.F. Nijboer 21-Sep-11 8:29am    
I'm very sorry for misunderstanding the question. But luckely others picked it up and helped you out. By the way... yahoo and facebook use OpenID and the equivalent for asp.net would be to use DotNetOpenAuth (previously known as DotNetOpenID). If you would use that you would also need to call FormsAuthentication.SignOut();

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