Jump to content

page posted automatically when back button is clicked


shane07

Recommended Posts

Hello to all

I have a problem with my page when back button is clicked.

I have set a session variable in my log-in page.

e.g. $_SESSION['userid']="logged";

Similarly for log-off page, I have unset the session variable

e.g. session_unregister('userid');

and used the header function and the log-in page is navigated.

At this point when back button is pressed twice, a dialog box appears which asks to post the data.

When OK button is clicked the previous post data is automatically posted and the user is logged in, I mean the session variable is set there.

What may be the problem?

 

Thanx for ur reply.

 

you should use session_unset(); too but since you are re-posting the post variables its as good as going to the form and entering the data again... I do not see any problem in it.. however they could be security issue on shared computers... but it cannot be avoided...

Follow this flow of coding.

 

(1) Login.php file // Fill up login information

(2) intermediate_action.php // Here keep an intermediate action file which contains database operations , Login check , Set of session variables etc...

(3) After step 2 redirect to other page like as user_account.php etc.

 

Check the above way.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.