Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check if a user is logged in javascript

jQuery(window).load(function() {
  //Set the login session 
  sessionStorage.setItem('status','loggedIn') 
});

//Check the login session
if (sessionStorage.getItem('status') != null))
    //redirect to page
	console.log('You are logged in');
}
else{
    //show validation message
  console.log('You are not logged in');
}
 
PREVIOUS NEXT
Tagged: #check #user #logged #javascript
ADD COMMENT
Topic
Name
3+1 =