Jump to content

SetCookie problem


Panjabel

Recommended Posts

<?php

if (isset($_COOKIE['registered']))

{

print "you are registered";

}

else

{

setcookie("registered", "username", time()+3600);

}

?>

 

if user is not registered, it doesn't set cookie

why ?

 

also

 

<?php

if (isset($_COOKIE['registered']))

{

print "OK";

}

else

{

print "NO";

}

?>

 

doesn't work too

please help

Link to comment
https://forums.phpfreaks.com/topic/59358-setcookie-problem/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.