Announcement

Collapse
No announcement yet.

Cookies

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cookies

    I am having a problem with cookies. I used setcookie to create the cookie, and it creates it, but what the problem is, is that when I close my browser, and go back to the page that uses the cookie, the cookie disappears. How can I keep the cookie going when I close the browser. I've done this before, but I forgot how i did it.

    Thanks!

  • #2
    You need to set how long the cookie will last.

    PHP Code:
    setcookie($cookie_name$cookie_val$time); 
    $time is usually equal to time() + however long you want the cookie to last, in seconds. I think 0 is for how long the browser is open, and less than time() is deleting the cookie. So if you want cookie to last ten days, put in $time paramater this:

    PHP Code:
    time() + (60 60 24 10 // number of seconds in 10 days 

    Comment


    • #3
      Thank You! I had the time set, but i think I put it to a number it didn't like, lol.
      Last edited by Nmare; Tue 9 Sep '03, 7:00pm.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X