开发者

Page redirection - after logged in - on back space - going to login page ! Why? Have session too

Am using PHP and Zend framework.

Index page is having a login form. After logging , check session and it will redirect to a myprofile page. After logging in if i try to type index page url directly, it will redirect to myprofile page.

But on backspace from myprofile page its going back to index login page!! Why? Even if session is there ,on backspace it is able to r开发者_开发技巧each login page. It should not happen. But if i refresh the login page it will go back to profile page.

Can anyone tell what i am missing? How can i fix the issue of backspce button. I am using PHP header to redirect.


Hitting backspace, or clicking the "back" arrow or whatever will not necessarily trigger a new request; the previous URL is still kept in the cache and restored.

This is the case for pages not POSTed to, anyways.


Make sure that your login page makes a POST request.

Play with Cache-control header of login page; maybe setting it to no-cache will help if nothing else helps.


Another solution might be to post to a new page that performs a redirect. This way, if the user hits the back button, they are really going back to a page which was intended to redirect them in the first place.

Default posts to loginredirect.php, loginredirect.php redirects to your primary page. If the user hits back, they go back to loginredirect.php which is set to forward them anyway.


It may be possible that when you load the login page you also clear the sessions. It may be a logout script as well at the same time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜