How to logout user session in from jsp? | Community
Skip to main content
Siva_Sogalapalli
Community Advisor
Community Advisor
October 16, 2015
Solved

How to logout user session in from jsp?

  • October 16, 2015
  • 2 replies
  • 1007 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sam205505050

system/sling/logout.html should solve your problem

2 replies

Sam205505050Accepted solution
Level 6
October 16, 2015

system/sling/logout.html should solve your problem

Siva_Sogalapalli
Community Advisor
Community Advisor
October 16, 2015

Yes, Thanks Sam ..