title: ajax login logout calls from same div don't fire until page refresh
body: <p>I am firing an ajax call for logging in a user to the website. The div "sitelogin" contains the login form parts. After successful ajax authentication the div "sitelogin" removes the login form parts and fills in the ajax html response. The response consists of a logout button and a div with "Welcome user".</p>
  
  <p>Now the logout button is attached to another ajax call for destroying the session and bring back the login parts into the "sitelogin" div. But it does not fire until I refresh the page. Please tell me why does the logout ajax call does not fire if I try to logout with the "logout" button immediately after the login ajax call fills in the "sitelogin" div with the logout response. Both the ajax calls are in the page header.</p>
  
  <p>I've posted more info here</p>
  
  <p><a href="https://stackoverflow.com/questions/18627573/php-ajax-login-and-logout-not-working-together-and-with-nobody-logged-onto-the-s">https://stackoverflow.com/questions/18627573/php-ajax-login-and-logout-not-working-together-and-with-nobody-logged-onto-the-s</a></p>
  
  <p>Please suggest!!</p>