Drupal 7 comes with jquery cookie plugin which can be find under
This plugin can be used to check if user is logged in or not directly from Jquery. We do that by checking if the cookie DRUPAL_UID exists and its value is not equal to 0.
But, how to identify a form? Give an id attribute in the form tag: