Jump to content

Cookie Problem


sweinkauf13

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...