Delete cookie when exit page

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Delete cookie when exit page

    Hi!

    When a user enter my page, a cookie is created.
    When the user leaves the page (closeing the page), the cookie needs to be
    deleted.

    How can I call an ASP-script when the user close/exit the page??

    Best regards,
    Øyvind Isaksen


    Øyvind Isaksen Guest

  2. Similar Questions and Discussions

    1. Delete Cookie Control?
      What kind of JavaScript is needed to delete all of the cookies for the current web site, and can that be registered in an ASP.NET page as a button?...
    2. Cookies set one time, I delete cookie, cookie is never set again!
      I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes,...
    3. #25136 [NEW]: THIS IS NOT A BUG (I think) just cookie issue, it doesnt delete!
      From: pmpp at sapo dot pt Operating system: Windows Xp PHP version: 4.3.2 PHP Bug Type: Unknown/Other Function Bug...
    4. Delete the cookie?
      Hello everyone, Does anyone know how to get rid of the cookies when the internet explorer window is closed after we use Forms authentication mode...
    5. How to delete a cookie?
      I need the statement for deleting a permanent cookie that I created earlier... The .NET documentation refers to the .discard property, but the...
  3. #2

    Default Re: Delete cookie when exit page

    You have to use client-side code for this. The webserver has no way of
    knowing if the user closes his browser. Try asking in client side code
    about executing a script when someone closes a browser or leaves your page.

    And if the cookie needs to be deleted as soon as the person is no longer at
    your site, what are you using the cookie for? You could use session
    variables instead, perhaps.

    Ray at home

    "Øyvind Isaksen" <oyvind@webressurs.no> wrote in message
    news:eeNqmXDkDHA.2268@TK2MSFTNGP12.phx.gbl...
    > Hi!
    >
    > When a user enter my page, a cookie is created.
    > When the user leaves the page (closeing the page), the cookie needs to be
    > deleted.
    >
    > How can I call an ASP-script when the user close/exit the page??
    >
    > Best regards,
    > Øyvind Isaksen
    >
    >

    Ray at Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139