session logout clarification | Community
Skip to main content
manikanthar1295
Level 5
Jun 6, 2021 6:25 AM UTC
Solved

session logout clarification

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.
Bhuwan_B
Bhuwan_BAccepted solution
New Participant
Jun 6, 2021 7:35 AM UTC

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
Bhuwan_BAccepted solution
New Participant
Jun 6, 2021 7:35 AM UTC

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.

 

Translate