Jump to content

Cookies Problem


wwedude

Recommended Posts

I just installed a user system, and I am trying to make a code that will check if you are logged in, and if you aren't you will be redirected to the login page.

<?php
if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){
echo "";
}
else {
header("Location: /go/membership/");
}
?>

 

But the problem, even after I log in, and the system sets the cookie, and I access this code, it will redirect me to the login page, where it says I am already logged in. The cookies are written right there, so what's the problem?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/131021-cookies-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.