Design and CSS styles
Version 6.x > Design and CSS styles > How to know the user is already logon if not look into database View modes: 
User avatar
Member
Member
steven4733-gmail - 1/5/2012 4:56:49 PM
   
How to know the user is already logon if not look into database
I found that after user logon, the logon web part is disappeared. So I am using jQuery to monitor, say the web part id="logonminiform", I use code:

if ($("[id$='logonminiform']").length > 0) {
.....
}else
{
......
}


I found it always shows the else statement even I signed out. What method you use to tell if the user is logon?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/5/2012 11:14:38 PM
   
RE:How to know the user is already logon if not look into database
Hello,

If you would use some custom code, this would be simple:

CMSContext.CurrentUser.IsAuthenticated

If you want to use javascript, please try to use it without jQuery, or the no conflict approach of jQuery, as otherwise it could cause issues with some of our web parts.

Best regards,
Boris Pocatko

User avatar
Member
Member
steven4733-gmail - 1/6/2012 3:06:42 PM
   
RE:How to know the user is already logon if not look into database
"If you want to use javascript, please try to use it without jQuery, or the no conflict approach of jQuery, as otherwise it could cause issues with some of our web parts."


Man, this information really saves me!