session logout clarification | Community
Skip to main content
manikanthar1295
Level 5
June 6, 2021
Solved

session logout clarification

  • June 6, 2021
  • 1 reply
  • 932 views

Hi,

Need some clarification on session in AEM.

When ever we create jcr session explicitly we need to session.logout() method to avoid  session leaking is my understanding is right.

 

But if we adopt session by workflow Session like below

Session session = worflowSession.adaptTo(Session.class);

did we need to close session by session.logout or not

i have written many workflow in my project by i have not done session.logout() will it automatically closing in case of workflowsession ??

 

 

 

 

 

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 Bhuwan_B

Please refer to below documentation URL:

https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-16548.html

 

Important Note:

Session and ResourceResolver objects that are obtained via the SlingRequest or WorkflowSession should not to be closed by your application.  For example:

slingRequest.getResourceResolver().adaptTo(Session.class); //Or workflowSession.getSession();

That resolver and session will be closed automatically after the request has been processed.

 

1 reply

Bhuwan_B
Community Advisor
Bhuwan_BCommunity AdvisorAccepted solution
Community Advisor
June 6, 2021

Please refer to below documentation URL:

https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-16548.html

 

Important Note:

Session and ResourceResolver objects that are obtained via the SlingRequest or WorkflowSession should not to be closed by your application.  For example:

slingRequest.getResourceResolver().adaptTo(Session.class); //Or workflowSession.getSession();

That resolver and session will be closed automatically after the request has been processed.