简体   繁体   中英

PHP: Auth Redirect issue

The Website I am working on has some weird cache issues. When I click on Sign In the first time it goes to the login page but when I logout and try to click on Sign In it redirects back to the homepage. Also when I access the site from b4m.bid4med.com/myaccount it redirects me to Login Page, after login it takes me back to b4m.bid4med.com/myaccount which redirects back to login page which then realizes I am logged in so redirects me to homepage. This all works fine when I disable cache in browser. I have also put the php code

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");

Sorry if I am not explaining it clearly.

I had some troublesome cache problems with login sessions too. Adding this header solved it for me:

header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); 

(could be anytime in the past i assume)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM