Remember Me problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

Remember Me problem

Post 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
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

send a flag in the query string if it's coming from the same page you're redirecting to
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

Post by Jim_Bo »

Hi,

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

Cheers
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Have a look at this thread, it should give you some ideas:
viewtopic.php?t=33632
Post Reply