Expand my Community achievements bar.

SOLVED

Mainataining sessions in AEM

Avatar

Level 4

Hi ,

While developing web applications we maintain the sessions.

Could anyone suggest how to maintain such session mechanism in AEM?

1 Accepted Solution

Avatar

Correct answer by
Level 9

AEM does maintain JCRSession which i not implicit but can be accessed from ResourceResolverFactory object as mentioned above (slingRequest.getResourceResolver().adaptTo(Session.class)) and you can do all the operation that you expect from HttpSession. But if you are really interested in HttpSession then you can get it from slingRequest object as it has extended the httpserveletrequest (slingRequest.getSession(true/false)). 

 

Let me know if you need more detail

View solution in original post

2 Replies

Avatar

Correct answer by
Level 9

AEM does maintain JCRSession which i not implicit but can be accessed from ResourceResolverFactory object as mentioned above (slingRequest.getResourceResolver().adaptTo(Session.class)) and you can do all the operation that you expect from HttpSession. But if you are really interested in HttpSession then you can get it from slingRequest object as it has extended the httpserveletrequest (slingRequest.getSession(true/false)). 

 

Let me know if you need more detail

Avatar

Level 10

Here is some good topics to read about AEM and Sessions:

http://docs.adobe.com/docs/en/aem/6-0/develop/personalization/client-context.html

http://cqdump.wordpress.com/2013/03/18/jcr-sessions-and-cq5/ (community article)

http://jackrabbit.apache.org/api/2.0/org/apache/jackrabbit/api/security/user/Authorizable.html

An older thread that talks about a related subject:

https://forums.adobe.com/message/4313632

To learn how to create a session when programming with AEM/JCR/OSGi - see:

http://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html

in this article, a ResourceResolverFactory is used to create a Session instance. A Session instance is created by using the adaptTo method.

These topics are all important to know when working with AEM.