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

session management in logout

Avatar

Avatar
Ignite 1
Level 1
dhiraj85
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile

Avatar
Ignite 1
Level 1
dhiraj85
Level 1

Likes

0 likes

Total Posts

17 posts

Correct Reply

0 solutions
Top badges earned
Ignite 1
Give Back
View profile
dhiraj85
Level 1

02-07-2020

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 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct Reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct Reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
vanegi
Employee

02-07-2020

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-...

Answers (3)

Answers (3)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

644 likes

Total Posts

605 posts

Correct Reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

644 likes

Total Posts

605 posts

Correct Reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

02-07-2020

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?

 

 

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

03-07-2020

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 🙂

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

02-07-2020

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