title: Check if user logged in on ajax page change
body: <p>As part of a webapp I'm building I'll need to check if the user is logged in whenever they change page. On a normal non-ajax site this is easy because I can just place the PHP session conditional statement in the header, and the header being called on every page change will determine whether the login page is displayed or not, but seeing as the header file is only set once within an ajax application, which is on the initial load, how can I check whenever the user makes an ajax page request whether or not the session is still valid? Since I'm using pushState and popState I know I can set the condition to run whenever the URL is changed, but I don't know exactly how to code the check to run whenever this happens.</p>
  
  <p>Any and all help appreciated.</p>
  
  <p>Thanks.</p>