Page 1 of 1

Remember Me problem

Posted: Thu Aug 11, 2005 7:34 pm
by Jim_Bo
Hi,

In the first page (call it index.php?pages=home) of the site I have inserted the following code to check if the user has cookie set:

Code: Select all

if (($_COOKIE['alias']) && ($_COOKIE['password'])) {

header("Location: ../index.php?pages=checkuser");

}
Once checkuser has been processed it then redirects them back to index.php?pages=home ..

The problem is a constant loop and the page never loads if the remember me cookie has been set ..

How is it ment to be done so it doesnt create the loop problem?


Cheers

Posted: Thu Aug 11, 2005 8:30 pm
by josh
send a flag in the query string if it's coming from the same page you're redirecting to

Posted: Fri Aug 12, 2005 1:49 am
by Jim_Bo
Hi,

Not exacly sure what you mean .. any chance you could elaberate .. or show an example

Cheers

Posted: Fri Aug 12, 2005 3:27 am
by patrikG
Have a look at this thread, it should give you some ideas:
viewtopic.php?t=33632