Results 1 to 6 of 6
  1. #1
    Newbie Affiliate Ian's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,540
    Cookie not expiring
    Hey, I set PHP to set a cookie for 60 seconds. But, even after a few minutes, it still exists when I run an if else statement. But after quite a long time (maybe 1 hour), it finally dies. Does the browser take extra time to delete and detect this data?

  2. #2
    ABW Ambassador DesignerWiz's Avatar
    Join Date
    January 18th, 2005
    Location
    U.S.A
    Posts
    2,777
    Hello Ian, is this cookie set for "during session" or "after session logout"?
    Ray Thomas
    Webmaster Resources: http://DesignerWiz.com
    ABW Board Category: Programming / Coding
    http://forum.abestweb.com/forumdisplay.php?f=190

  3. #3
    Newbie Affiliate Ian's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,540
    Hey Ray,

    Haven't truly figured out sessions in PHP yet but here is my code:

    setcookie("variable",$va,time()+60,"/",".$mydomain",0);

    Which one would this be?

  4. #4
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    I think the expire is just too short. The client time and server time can be different. Usually is different too when dealing with such short expire times. What is the purpose of such a short expire time? Maybe there's a better way to do what you want?
    Lead, Follow or Get Out of the Way!

  5. #5
    Newbie Affiliate Ian's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,540
    Hey Buddha,

    I was trying to test to see if my cookie writing script works. When I run it, it will be more like 30, 60 or 90 days but I didn't want to wait that amount of time to test life span. Hence 60 seconds to test.

  6. #6
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    Quote Originally Posted by Affiliate Ian
    When I run it, it will be more like 30, 60 or 90 days ...
    Those are definitely more reasonable amounts of time. I would suggest inspecting the actual cookie that the browser sets. This is easy with Firefox (Tools>Options>Privacy>Cookies>View Cookies) but it can be done with Internet Explore too. With Internet Explorer you'll need to figure out where the cookie file is stored this varies depending on which version of Windows and Internet Explorer. This might help with Internet Explorer: http://www.microsoft.com/info/cookies.mspx

    Might find this site useful when dealing with Unix time: http://www.onlineconversion.com/unix_time.htm
    Lead, Follow or Get Out of the Way!

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Buying an expiring domain
    By Paul_Ward in forum Midnight Cafe'
    Replies: 7
    Last Post: September 29th, 2004, 01:24 PM
  2. Expiring Domain
    By dak142 in forum Midnight Cafe'
    Replies: 11
    Last Post: May 17th, 2004, 10:43 PM
  3. non expiring cookie length?
    By Joe Gardner in forum ShareASale - SAS
    Replies: 11
    Last Post: March 4th, 2003, 07:58 AM
  4. FreeDiscs.com expiring - anyone want it?
    By jkfjkf123 in forum Midnight Cafe'
    Replies: 3
    Last Post: September 16th, 2002, 05:23 AM

Posting Permissions

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