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.