SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot Pie's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cookie Deletion? Define deletion?

    Anyway i can actually delete cookies?
    Any way i can delete variables from the DEFINE command.
    Zach Inglis
    Reality Art Studios Ltd
    ZachInglis.com Blog |
    Art / Code Chat & Tutorials | Work

  2. #2
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just set the expiry date of your cookie to the past, or use unset($_COOKIE)

    And DEFINE is meant for constants, ie DEFINE('GRAVITY', '9.8') so if you want to modify/change it just use a normal variable.

  3. #3
    SitePoint Zealot Pie's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, thats what i was expecting.
    Zach Inglis
    Reality Art Studios Ltd
    ZachInglis.com Blog |
    Art / Code Chat & Tutorials | Work

  4. #4
    SitePoint Zealot Pie's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still no luck with cookie deletion.
    Zach Inglis
    Reality Art Studios Ltd
    ZachInglis.com Blog |
    Art / Code Chat & Tutorials | Work

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2004
    Location
    Sweden
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know what the problem could be, if a cookie is set with a past timevalue, the browser will simply delete it.
    I use this code to delete my cookies:
    [php]setcookie ("name","",time()-3600);[php]

  6. #6
    SitePoint Enthusiast
    Join Date
    May 2004
    Location
    Sweden
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    doh

  7. #7
    SitePoint Zealot Pie's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you forgot the / in [/php ]
    yes, thats true. I want to DELETE my cookies BEFORE the time validation.
    Zach Inglis
    Reality Art Studios Ltd
    ZachInglis.com Blog |
    Art / Code Chat & Tutorials | Work

  8. #8
    SitePoint Zealot Pie's Avatar
    Join Date
    Aug 2003
    Location
    UK
    Posts
    198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    found out how to fix it
    set the value as 0
    Zach Inglis
    Reality Art Studios Ltd
    ZachInglis.com Blog |
    Art / Code Chat & Tutorials | Work


Bookmarks

Posting Permissions

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