Class MongoSession

java.lang.Object
org.springframework.session.data.mongo.MongoSession
All Implemented Interfaces:
Session

public final class MongoSession extends Object implements Session
Session object providing additional information about the datetime of expiration.
Since:
1.2
  • Constructor Details

    • MongoSession

      public MongoSession(String sessionId)
      Constructs a new instance using the provided session id.
      Parameters:
      sessionId - the session id to use
      Since:
      3.2
    • MongoSession

      public MongoSession()
    • MongoSession

      public MongoSession(long maxInactiveIntervalInSeconds)
    • MongoSession

      public MongoSession(String id, long maxInactiveIntervalInSeconds)
    • MongoSession

      public MongoSession(SessionIdGenerator sessionIdGenerator)
      Constructs a new instance using the provided SessionIdGenerator.
      Parameters:
      sessionIdGenerator - the SessionIdGenerator to use
      Since:
      3.2
  • Method Details

    • changeSessionId

      public String changeSessionId()
      Description copied from interface: Session
      Changes the session id. After invoking the Session.getId() will return a new identifier.
      Specified by:
      changeSessionId in interface Session
      Returns:
      the new session id which Session.getId() will now return
    • getAttribute

      @Nullable public <T> T getAttribute(String attributeName)
      Description copied from interface: