Class PlayCookieSessionStore

  • All Implemented Interfaces:
    org.pac4j.core.context.session.SessionStore

    @Singleton
    public class PlayCookieSessionStore
    extends Object
    implements org.pac4j.core.context.session.SessionStore
    A session store which only uses the Play Session cookie for storage, allowing for a stateless backend.
    Since:
    6.1.0
    Author:
    Vidmantas Zemleris
    • Field Detail

      • JAVA_SERIALIZER

        public static final org.pac4j.core.util.serializer.JavaSerializer JAVA_SERIALIZER
    • Constructor Detail

      • PlayCookieSessionStore

        public PlayCookieSessionStore()
      • PlayCookieSessionStore

        public PlayCookieSessionStore​(DataEncrypter dataEncrypter)
    • Method Detail

      • getSessionId

        public Optional<String> getSessionId​(org.pac4j.core.context.WebContext context,
                                             boolean createSession)
        Specified by:
        getSessionId in interface org.pac4j.core.context.session.SessionStore
      • get

        public Optional<Object> get​(org.pac4j.core.context.WebContext context,
                                    String key)
        Specified by:
        get in interface org.pac4j.core.context.session.SessionStore
      • getSessionValues

        protected Map<String,​Object> getSessionValues​(org.pac4j.core.context.WebContext context)
      • set

        public void set​(org.pac4j.core.context.WebContext context,
                        String key,
                        Object value)
        Specified by:
        set in interface org.pac4j.core.context.session.SessionStore
      • putSessionValues

        protected void putSessionValues​(org.pac4j.core.context.WebContext context,
                                        Map<String,​Object> values)
      • destroySession

        public boolean destroySession​(org.pac4j.core.context.WebContext context)
        Specified by:
        destroySession in interface org.pac4j.core.context.session.SessionStore
      • getTrackableSession

        public Optional<Object> getTrackableSession​(org.pac4j.core.context.WebContext context)
        Specified by:
        getTrackableSession in interface org.pac4j.core.context.session.SessionStore
      • buildFromTrackableSession

        public Optional<org.pac4j.core.context.session.SessionStore> buildFromTrackableSession​(org.pac4j.core.context.WebContext context,
                                                                                               Object trackableSession)
        Specified by:
        buildFromTrackableSession in interface org.pac4j.core.context.session.SessionStore
      • renewSession

        public boolean renewSession​(org.pac4j.core.context.WebContext context)
        Specified by:
        renewSession in interface org.pac4j.core.context.session.SessionStore
      • clearUserProfiles

        protected Object clearUserProfiles​(Object value)
      • uncompressBytes

        public static byte[] uncompressBytes​(byte[] zippedBytes)
      • compressBytes

        public static byte[] compressBytes​(byte[] srcBytes)
      • getSessionName

        public String getSessionName()
      • setSessionName

        public void setSessionName​(String sessionName)