Tamer Zoubi @ Drupal 8


Drupal expert | Programmer

user

Drupal 7 check if user is logged in from javascript

Drupal 7 comes with jquery cookie plugin which can be find under

misc/jquery.cookie.js

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.

Tags
anonymous
authenticated
COOKIE
Drupal 7
drupal_uid
javascript
jquery
jQuery.cookie is not a function
user