Mainataining sessions in AEM | Community
Skip to main content
Level 3
October 16, 2015
Solved

Mainataining sessions in AEM

  • October 16, 2015
  • 2 replies
  • 922 views

Hi ,

While developing web applications we maintain the sessions.

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

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 Pawan-Gupta

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

2 replies

Pawan-Gupta
Pawan-GuptaAccepted solution
Level 8
October 16, 2015

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

smacdonald2008
Level 10
October 16, 2015

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.