problems logging out with cookies

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
php-forum Fan User
php-forum Fan User
Posts: 64
Joined: Thu Aug 22, 2002 1:07 am

Thu Aug 29, 2002 4:47 am

i have a page that uses for loging in cookies containing the user id. when i log-out,i delete the cookie.the problem is that after loging in,if the user presses the back button he can enter the site and still use some of the scripts that i can't protect with cookies.if after hiting back it hits refresh,he gets kicked out of the site.

???How can i refresh the page automatically when i hit back???? :?:
php-forum Fan User
php-forum Fan User
Posts: 67
Joined: Tue Jul 09, 2002 8:45 am
Location: East Coast, USA

Thu Aug 29, 2002 4:52 am

Im not sure about refreshing, but you could use session variables. When you log out, you can set a session variable to false, and just check that on every page you want to keep secure. This would work if I understand your question clearly, but im not sure if I do. Let me know.


Thu Aug 29, 2002 2:03 pm

Try inserting these between the head tags:

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">

If I understand them correctly they'll try to get a new copy of a page every time it's accessed instead of using the local cached version!
Post Reply