session object | Community
Skip to main content
AdobeID24
Level 5
August 19, 2019
Solved

session object

  • August 19, 2019
  • 1 reply
  • 1286 views

As we know that we usually  get the session object with the help of systemuser .

but in a servlet we can get session object without creating system user because in servlet we will have request and response object .with the help of these objecyts we can get the session object without creating system user .

whats the difference between both and in which scenerio we will use which one ?

creating system user and then getting session object through resourceresolver is preferrable way , whats the reason behind it ?

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 arunpatidar

Hi,

The subservice session is allow to get session with system user and system user privileges based on service user but getting session from request in servlet allow to get session from current user.

When to use subservice user or session from request in servlet:

When you are not sure about current users privileges to read/write from repo, then use sub service session which get privileges of predefined system user. If need to perform based on user then adapt the session from request.

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 19, 2019

Hi,

The subservice session is allow to get session with system user and system user privileges based on service user but getting session from request in servlet allow to get session from current user.

When to use subservice user or session from request in servlet:

When you are not sure about current users privileges to read/write from repo, then use sub service session which get privileges of predefined system user. If need to perform based on user then adapt the session from request.

Arun Patidar