Forum Moderators: mack
I am trying to use cookies to protect specific pages on my site.
Let me give the situation...
Person logs in
If password wrong, they are directed to a registration page. If correct to specific pages. I set a cookie at this stage.
I would like to use the cookie on other pages and so call upon it, this works well.
The client can then browse through the site and logout when they finish. At this stage the cookie is destroyed.
The problem is when i type the url to any one of the pages i would like protected, it goes throuhg and displays content.
How can i avoid this?
Please advice.
Saboi
a cookies is created which is repeated on every page
Have you considered using sessions instead of cookies for your authentication? That way you wouldn't have to check the cookie just a session variable.