Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
top
top

In This Section

Table of Contents
maxLevel2

...

Session Management is handled by the Session Manager service which only provides getters and instantiate methods for the first session type; the nl.gx.webmanager.foundation.Session. Because this is a wrapper around the other two sessions, you always have access to all three sessions if you have access to this session. The major purpose of the session is to define authorization. Authorization depends on the roles associated with the user stored in the session.

 

Session Stack

When an editor is working in the Workspace, the sessions are created automatically by the XperienCentral framework. For each request, XperienCentral identifies the user according to the cookie sent, together with the request, and creates a new XperienCentral session. This XperienCentral session is put on the top of the “session stack”. When the response is sent back to the client, this session is removed from the stac, therefore this session exists during the complete lifetime of the request.

...

  • Session 1 is created and closed automatically by the framework
  • Plugin 2 creates its own session 2 and closes it afterwards
  • Plugin 3 creates its own session 3 and invokes a service from plugin 4
  • The service in plugin 4 creates its own session 4 and closes it afterwards
  • The session 3 is closed by plugin 3
  • The framework automatically closes session 1

 

Back to Top

 

...

Retrieving and Creating Sessions

In some cases you can use an active session from the top of the stack created by another plugin or by the framework. In that case, simply invoke SessionManager.getActiveSession() to retrieve that active session. You should never close this session yourself, since you are not the one who created it. Leave this up to the creator of the session.

...