Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
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