kannu Posted November 27, 2008 Share Posted November 27, 2008 hello, I have a Session variable, where value is stored based on user selection. However, I want to restore the value of the variable to a default value, everytime the user loads the page again (such as refreshing the page, or by hitting the back/forward button on his browser). Therefore each time the page is loaded again, I want to restore the value of session variable to a default value. How can I do this, if someone can please help me out. thanks ps: I have already tried following which has not worked: I tried $_SESSION['passMe']= some default value; as the first line inside the <body> tag, thinking the the session variable value would be restored to default value each time the page loads again, but this does not happen. the variable value is not restored, and it retains the user selection. Quote Link to comment Share on other sites More sharing options...
Schlo_50 Posted November 27, 2008 Share Posted November 27, 2008 When you've finished using your session you could un set it. unset($_SESSION['variableName']); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.