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

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.

Up vote 1 down vote favorite share g+ share fb share tw.

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 reach 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.

Php zend-framework php5 session redirect link|improve this question edited Mar 31 '11 at 0:02Charles19.1k51836 asked Jan 19 '11 at 18:45zod2,0971418 91% accept rate.

The backspace key goes back unless an input/textarea element is focus. This is common to most browsers, and you shouldn't be trying to suppress this behaviour. – meagar Jan 19 '11 at 18:51 @meagar am not trying to suppress backspace behavior , but it should come back to my profile page on back space.

That redirection is not happening only on back space . That is the issue. On backspace ,the form will be loading is it?

Why session check fail only on backspace? – zod Jan 19 '11 at 18:54 The previous page will be loaded from your browser cache. – meagar Jan 19 '11 at 18:56.

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.

If we loggin any mail like gmail or hotmail , after reaching inbox if we press backspace it will refresh page.it will not go back to login page. How it is done! – zod Jan 19 '11 at 18:59 @zod Those site make excessive use of so called "Web 2.0" techniques, where the page is only partially updated and no new "fresh" request takes places.

– Linus Kleen Jan 19 '11 at 19:00.

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.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions