Click to See Complete Forum and Search --> : $HTTP_COOKIE_VARS not working!!!!
I keep trying to set a cookie to hold the value of a user id from a mysql db. If I set the cookie expire to '0', it should make the cookie last until the browser is closed, but it is not even saving the cookie. If I use a time, it will save the cookie, but then I still can not acces it from anywhere. I tried both methods -- just calling $id and also $HTTP_COOKIE_VARS["id"]. Neither are working. Is there something from the defualt install that I am missing? Do I need to change a setting? Please help me.
linus
06-29-2002, 07:56 AM
As far as I know, setting the expire time to zero will delete the cookie. In fact, I've had trouble accessing cookies where the expire time was less than a few minutes in the future. Session cookies expire once the user closes the browser, those may be what you're thinking of.
Then again, I could be all wrong. :)
jstirrup
06-29-2002, 04:12 PM
Thank You, I went ahead and used the setcookie() function with just the cookie name and the value and it worked. I had heard that setting the time to zero would make the cookie last for that session and that setting the same cookie without a vaule and just the name would delete it. I don't know about the latter, but setting the time to zero sure does remove it. Thanks Again!
"Back on the Happy Boat and well on my way!"
Jon
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.