Class CmsJspLoginPersistingBean

    • Method Detail

      • getCookiePath

        public java.lang.String getCookiePath​(boolean resolveMacros)
        Gets the path to use for the authorization cookie, optionally resolving any macros used.

        Parameters:
        resolveMacros - if true, macros should be resolved
        Returns:
        the authorization cookie path
      • isTokenSet

        public boolean isTokenSet()
        Returns true if the token has been set.

        Returns:
        true if the token has been set
      • login

        public void login​(java.lang.String userName,
                          java.lang.String password,
                          java.lang.String projectName)
        Description copied from class: CmsJspLoginBean
        Logs a system user into OpenCms.

        Note that if a login project name is provided, this project must exist, otherwise the login is regarded as a failure even if the user data was correct.

        Overrides:
        login in class CmsJspLoginBean
        Parameters:
        userName - the users name
        password - the password
        projectName - the project to switch to after login (if null project is not switched)
        See Also:
        CmsJspLoginBean.login(java.lang.String, java.lang.String, java.lang.String)
      • logout

        public void logout()
                    throws java.io.IOException
        Description copied from class: CmsJspLoginBean
        Logs a user out, i.e. destroys the current users session, after that the current page will be redirected to itself one time to ensure that the users session is truly destroyed.

        Overrides:
        logout in class CmsJspLoginBean
        Throws:
        java.io.IOException - if redirect after logout fails
        See Also:
        CmsJspLoginBean.logout()
      • logout

        public void logout​(boolean invalidateToken)
                    throws java.io.IOException
        Logs the user out and optionally invalidates their login token.

        Parameters:
        invalidateToken - true if the token should be invalidated
        Throws:
        java.io.IOException - if something goes wrong
      • setCookiePath

        public void setCookiePath​(java.lang.String cookiePath)
        Sets the path to use for the login token cookie.

        You can use the macros %(SERVLET_NAME) and %(CONTEXT_NAME) in the cookie path; the default value is %(CONTEXT_NAME)%(SERVLET_NAME).

        Parameters:
        cookiePath - the cookie path, possibly including macros
      • setTokenLifetime

        public void setTokenLifetime​(long lifetime)
        Sets the number of milliseconds for which the tokens should be valid.

        Parameters:
        lifetime - the token life time