Skip to main content
Level 9
Nov 17, 2015 5:29 AM UTC
Solved

Obtain session instance in CQ

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.
edubey
edubeyAccepted solution
Level 10
Nov 17, 2015 5:37 AM UTC

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
Level 10
Nov 17, 2015 5:37 AM UTC

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

Translate