0

I have a page which sets the a value of a js variable for customer authentication to false inside "jQuery(document).ready(function()" when it is loaded for the first time.

but after customer authenticates himself and then comes back to that same page, that page is loaded from cache and the value still remains as it is

So is there a way by which i can force that variable to reset itself ??

3
  • you could use cookie instead of a js variable Commented May 8, 2013 at 9:24
  • Are you redirecting the user to that page after authentication? Redirection should not refill the data from cache. Commented May 8, 2013 at 9:25
  • I have a link on d page which redirects to home page when authenticated or opens a login page dialog when unauthenticated Commented May 8, 2013 at 9:28

1 Answer 1

1

can check when the page becomes visible using-

$('#mypage').live('pageshow', function (event) {
          //Reset the vars here.. 
        });

OR

shorter way is

window.onpageshow = function(event) {
    //event.persisted)
    //Reset the vars here.. 

};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.