Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

session management in logout

dhiraj85
Level 2
Level 2

Hi friends

             can you please tell me how to do session management in logout process in AEM 6.5, i have a login credential now i want to make logout with session, please suggest me.

 

 

Thanks 

Dhiraj Kumar 

1 Accepted Solution
vanegi
Correct answer by
Employee
Employee

You can look at Encapsulated Tokens [0]. For this, the users must pre-exist on all the publish instances, if this is not possible, then you should use sticky connections.

 

To close the session, you can use session.logout(), check [1].

 

[0]: https://docs.adobe.com/content/help/en/experience-manager-65/administering/security/encapsulated-tok...

 

[1]: https://helpx.adobe.com/in/experience-manager/kb/check-and-analyze-if-JCR-session-leaks-in-your-AEM-...

View solution in original post

8 Replies
vanegi
Correct answer by
Employee
Employee

You can look at Encapsulated Tokens [0]. For this, the users must pre-exist on all the publish instances, if this is not possible, then you should use sticky connections.

 

To close the session, you can use session.logout(), check [1].

 

[0]: https://docs.adobe.com/content/help/en/experience-manager-65/administering/security/encapsulated-tok...

 

[1]: https://helpx.adobe.com/in/experience-manager/kb/check-and-analyze-if-JCR-session-leaks-in-your-AEM-...

View solution in original post

Nupur_Jain
Community Advisor
Community Advisor

Hi @dhiraj85 

 

To logout, you can use session.logout() method of JCR Session API. Refer https://www.programcreek.com/java-api-examples/?class=javax.jcr.Session&method=logout for eaxmples.

 

Hope it helps!

Thanks,

Nupur

dhiraj85
Level 2
Level 2

Hi nupur

                is this helpful in AEM?, because of i am new in AEM so i am getting confuse, it seem as java session management .

Nupur_Jain
Community Advisor
Community Advisor

Hi @dhiraj85 

 

No it is of java session, we are talking here. This is JCR(Java content respository) session that is more specific to AEM as AEM repository is based on JCR implementation. If you are looking for a way to logout using backend then this reference given above can be used. Read more from  https://docs.adobe.com/content/help/en/experience-manager-64/developing/platform/access-jcr.html and https://docs.adobe.com/content/docs/en/spec/jdiff-jcr1-jcr2/jcr-2.0/javax/jcr/Session.html

 

BrianKasingli
Community Advisor
Community Advisor

Assuming that you have the Session a valid non-null object, you can easily just call the logout method. Example Below:

 

 

if (session != null && session.isLive()) {
     session.logout();
}

 

But it really depends on the context. How is the session obtained?

 

 

Jörg_Hoh
Employee
Employee

Hi,

can you please describe what you mean with "session logout" in more detail? The term "session" can describe a lowlevel implementation API, which does have a logout method. On the other hand side it can also mean the session of a user, which has authenticated against an AEM authoring instance and is working, until he logs out (and cannot visit the UI of that authoring instance until he logs in again).

Dependent on that the answer is quite different 🙂