sweinkauf13 Posted September 30, 2008 Share Posted September 30, 2008 Hey, I'm having a problem with setting a cookie. Here is my php script. <html><head><title>I'm A Cookie</title></head><body><?setcookie("test", "ok", "time()+900", "/", "localhost", 0);?><h1>I'm A Cookie</h1></body></html> and here is the error message:Warning: setcookie() expects parameter 3 to be long,I'm really not sure whats wrong. If you could help that would be great.thanks alot,youngwebmaster Link to comment Share on other sites More sharing options...
justsomeguy Posted October 1, 2008 Share Posted October 1, 2008 Remove the quotes from the 3rd parameter. Quoting something makes it a string of text. You're trying to set the expiration date of the cookie to the text "time()+900". "time()+900" isn't a valid date (or number, in this case). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.