Obtain session instance in CQ | Community
Skip to main content
November 17, 2015
Solved

Obtain session instance in CQ

  • November 17, 2015
  • 1 reply
  • 609 views

Hi All,

In order to obtain a session,

final SlingRepository repos = sling.getService(SlingRepository.class); and session = repos.loginAdministrative(null); is used in the article https://helpx.adobe.com/experience-manager/using/using-ajax-requests-display-cq.html . But I read somewhere that loginAdministrative is now deprecated.

Can you please let me know, some of the other ways in which a session can be obtained.

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 edubey

Hi,

Right those are deprecated, Now you need to create service and map that service to user in OSGI

Take a look at step by step guide here @ http://www.wemblog.com/2014/08/how-to-use-sessions-and-resource.html

1 reply

edubey
edubeyAccepted solution
November 17, 2015

Hi,

Right those are deprecated, Now you need to create service and map that service to user in OSGI

Take a look at step by step guide here @ http://www.wemblog.com/2014/08/how-to-use-sessions-and-resource.html