Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 149535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:08:46+00:00 2026-05-11T09:08:46+00:00

I have a login link that fires a javascript function that calls a logout

  • 0

I have a login link that fires a javascript function that calls a logout page. This is what the logout page consists of:

 If Response.Cookies.Count > 0 Then     Response.Cookies('aLog').Value = Nothing     Response.Cookies.Clear() End If 

Originally I just had cookies.clear in there, but that wasn’t working.

Here is the javascript that send the request to the logout page:

<script type='text/javascript'>     //<![CDATA[     $(document).ready(function() {         $('#logout-link').click(function() {             if (confirm('Really log out?')) {                 $.cookie('aLog', null);                 location.href = $(this).attr('href');             }             return false;         });     });     //]]> </script> 

The jQuery function $.cookie does not work either. The cookie is set by ASP.NET, so I figured I could unset it with ASP.NET too but apparently not. Any ideas/suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:08:47+00:00Added an answer on May 11, 2026 at 9:08 am

    Working with cookies in ASP.NET can be a little un-intuitive. To kill a cookie that already lives on the client-side, you have to set its expiration date to sometime in the past, and re-send the client the new cookie. The client browser will update the existing cookie with the new expiration date, and then immediately kill it since it has already passed the expiration date:

    HttpCookie cookie = Request.Cookies['aLog']; cookie.Expires = DateTime.Now.AddYears(-10); Response.AppendCookie(cookie); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple GAE app that includes a login/logout link. This app is
In my View, I have included the css : <link rel=stylesheet type=text/css href='<%=Url.Content(~/Content/login.css)%>'/> in
Assume that I have login to system using PHP + MySQL, then, after I
Normally we have login page with username, password filed and signin button. Using the
Hi I want to create a WCF service that have login method, which is
Basically, I currently have login/ in urls.py redirect to the django.contrib.auth.views.login and that seems
I am a beginner of asp.net..I currently have a login page with forgot password
I have a jsp that contains a css link that looks like <link type=text/css
I have an inline script on my page as such: <script type=text/javascript> var rootPath
I have login- and game-layout in my activity. I would use AndroidAnnotations in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.