Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to logout user session in from jsp?

Avatar

Community Advisor

Hi,

I've requirement where I need to log-out user from jsp at certain condition. I tried this:

javax.jcr.Session userSession  = resourceResolver.adaptTo(javax.jcr.Session.class);
System.out.println("User Id:"+userSession.getUserID());
userSession.logout();

I got the logged in user session, but logout() method didn't work for me. Please suggest me, Quick response would be appreciated..

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 6

system/sling/logout.html should solve your problem

View solution in original post

2 Replies

Avatar

Correct answer by
Level 6

system/sling/logout.html should solve your problem