if( isset($_COOKIE['user']) && !empty($_COOKIE['user']) ){
header("Location: ./");
}
This is my code for login page. What I want to achieve is whenever someone is logged in [if a cookie named user exists], the user should be redirected to the homepage. I am using mod_rewrite to write URLs.
The problem I am facing is that whenever the cookie exists, and I go to localhost/project/login/, it shows ERR_TOO_MANY_REDIRECTS:
However when I use localhost/project/login.php it works fine.
