I'm trying to handle multiple user login sessions by creating user specific sessions. Below is the code snippet of the same.
ResourceResolver resourceResolver = request.getResourceResolver();
Resource userResource = resourceResolver.getResource(config.getUserDataFolderPath() + '/' + userProfile.getUid());
LOGGER.info("User specific resource in resource format is {}", userResource);
assert userResource != null;
Session userSpecificSession = userResource.adaptTo(Session.class);
LOGGER.info("User specific session is {}", userSpecificSession);
The below line is returning null. Can someone please help me to understand why is this happening?
Session userSpecificSession = userResource.adaptTo(Session.class);