SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I set a cookie so it never expires? I need to get the set variable each time the user comes to the site and if it isn't there they need to be directed to another page. I have tried several avenues but I always end up at the beginning again.

  2. #2
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't but you can make it expire in several years.

    Owen

  3. #3
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the format I am using right now and it doesn't seem to work in Netscape but does seem to work in IE5.

    setcookie( "plugin", "YES", time()+360000000000, "/", ".mydomain.com", 0);

  4. #4
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you accessing your files that use to cookies with the WWW?

    NS requires that you use the www. in front of any site that you want to use cookies on.
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  5. #5
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No I am not using WWW but I THINK(HOPE) I have solved the problem with this code.

    setcookie( "plugin", "YES", time()+36000000, "/", ".mydomain.com", 0);

    I made the time addition a little shorter and I now call this line of code whenever a user that has the variable set, so it updates the expiration time each time they visit.

    Thanks all.


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
  •