Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.