is it possible to know when cookies expire ?

Discussion in 'HTML' started by Mel, Mar 16, 2005.

  1. Mel

    Mel Guest

    i need my application to goto a URL when the cookies are expired. this way i
    can log them out of my system altogether

    thanks
    Mel, Mar 16, 2005
    #1
    1. Advertising

  2. Mel

    Steve Pugh Guest

    "Mel" <> wrote:

    >i need my application to goto a URL when the cookies are expired. this way i
    >can log them out of my system altogether


    An expired cookie should no longer be stored by the browser - it will
    normally be deleted. Hence your application has no way of
    distinguishing between a visitor with an expired cookie and a visitor
    who never had the cookie in the first place.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Mar 16, 2005
    #2
    1. Advertising

  3. Mel

    mbstevens Guest

    Mel wrote:

    > i need my application to goto a URL when the cookies are
    > expired. this way i can log them out of my system
    > altogether
    >
    > thanks


    They disappear by default when the visitor quits browser.
    To last longer *you* must set an expiration date on the
    cookie. Even though you set this, only the value and
    name are available to read. The ";Expires=..." is read
    in as a command, not as data. Obviously, if you can't
    read the cookie, it is expired. However, you can put a
    copy of the expire date into the value of the name/value
    pair if you really find it necessary.

    Remember that a lot of surfers, like myself, have their
    browsers set to kill cookies (evil little roaches that
    they are) on leaving the browser, no matter what the
    expiration date happens to be.
    mbstevens, Mar 16, 2005
    #3
  4. Mel

    Toby Inkster Guest

    Mel wrote:

    > is it possible to know when cookies expire ?


    Check the back of the packet. I've found out that most packet cookies are
    actually OK for about a month after the sell-by date, though freshly-baked
    ones don't last much longer than a couple of days.

    HTH!

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Now Playing ~ ./sparklehorse/sick_of_goodbyes_single/01_sick_of_goodbyes.ogg
    Toby Inkster, Mar 16, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joey Powell

    Forms Authentication Cookies Never Expire

    Joey Powell, Dec 4, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    6,928
    Mike Moore [MSFT]
    Dec 4, 2003
  2. th3dude
    Replies:
    4
    Views:
    653
    th3dude
    Jul 24, 2008
  3. _Who
    Replies:
    7
    Views:
    2,660
  4. Tongass Park Neighborhood Association, Juneau Alas

    Cookies expire immediately, not when set to expire

    Tongass Park Neighborhood Association, Juneau Alas, Oct 1, 2009, in forum: ASP General
    Replies:
    2
    Views:
    1,201
    SQLDude
    Nov 24, 2009
  5. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    232
    Gregory Toomey
    Apr 23, 2004
Loading...

Share This Page