Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a site with logout button.when i click on logout button cookies should be deleted and it should navigate to login page.
I am working on classic asp

What I have tried:

<script language="Javascript">

 function fnOnClicklogout()
 {
 	top.location.href="login-form.htm";
	Session.Clear()
        Session.Abandon()
        Session.Abandon() 

 }
</script>
Posted
Updated 22-Sep-17 5:17am
Comments
F-ES Sitecore 22-Sep-17 9:29am    
I'm sure if you google "clear cookies classic asp" or "clear cookies javascript" you'll get your answer. You effectively set the expiry date of the cookie to a time in the past and the browser will remove it.

PS you can't call server-methods like Session.Abandon from javascript on the client
Member 11416690 22-Sep-17 9:48am    
ya i got some answers but those are not working.can u help me
[no name] 22-Sep-17 11:17am    
What issue you are facing?
Member 11416690 23-Sep-17 5:39am    
cookies are not deleting
Karthik_Mahalingam 25-Sep-17 23:50pm    
use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.

1 solution

Try with below way it should solve your issue -

asp.net - Remove cookie on log-out - Stack Overflow[^]
 
Share this answer
 
Comments
Richard Deeming 22-Sep-17 12:53pm    
The OP did say they're using "classic" ASP, not ASP.NET, so that answer won't work.

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