<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Seems there are 2 things here:<br>
      <br>
      1) Username "hint" provided by KEYCLOAK_REMEMBERME cookie. IMO
      this cookie should be deleted only when:<br>
      - User explicitly clicked on logout and maually logout himself<br>
      - User click on "Login" button on login screen without the
      rememberme checkbox checked<br>
      <br>
      IMO it shouldn't be deleted when SSO cookie is expired, which is
      current behaviour and should be changed IMO. In other words, I
      expect the scenario working like:<br>
      - User logged with "rememberMe" checkbox on<br>
      - User closed the browser<br>
      - After a month, user returned back to the application. His SSO
      session is expired, but KEYCLOAK_REMEMBERME cookie won't be
      deleted, so on login screen he will see the prefilled username and
      rememberMe checkbox switched to "on"<br>
      <br>
      <br>
      2) Persistent KEYCLOAK_IDENTITY cookie when rememberMe is switched
      to on. I can't see how it can work when session is expired as it
      relies on session in the cookie value. On the other hand,
      rememberMe shouldn't rely on "SSO Session idle timeout" IMO.  SSO
      IDle timeout is only 30 minutes by default. So current behaviour
      is, that when user closes his browser, he needs to open in again
      and being re-authenticated only when he do within 30 minutes,
      which is bit of pointless IMO. <br>
      <br>
      I would suggest to change the behaviour like this:<br>
      - When userSession is marked as rememberMe, then cleaner thread
      will take into account just "SSO Max Lifespan" timeout, but not
      SSO Idle timeout<br>
      - During verification of SSO cookie re-authentication and when
      session is rememberMe, we will take into account just SSO Max
      Lifespan of session, but not SSO Idle timeout<br>
      Refreshing of tokens will still take SSO Idle timeout just like
      now.<br>
      <br>
      If we not change the behaviour like this, we should at least
      update "RememberMe" docs and tooltip to make it more clear what
      the behaviour would be in various cases.<br>
      WDYT?<br>
      Marek<br>
      <br>
      On 31/03/16 16:26, Libor Krzyzanek wrote:<br>
    </div>
    <blockquote
      cite="mid:5A171A64-64FC-431F-844A-E37E5A92892E@redhat.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div class="">I read docs today <a moz-do-not-send="true"
href="http://keycloak.github.io/docs/userguide/keycloak-server/html/timeouts.html#d4e2630"
          class="">http://keycloak.github.io/docs/userguide/keycloak-server/html/timeouts.html#d4e2630<br
            class="">
        </a> and my understanding is that user should keep logged in
        after either browser restart or session expiration.</div>
      <div class="">My tests shows that after session expiration (set to
        1 min) I have to log in again.</div>
      <div class=""><br class="">
      </div>
      <div class="">Thanks,</div>
      <div class="">
        <div class=""><br class="">
        </div>
        <div class="">
          <div class="">
            <div style="color: rgb(0, 0, 0); letter-spacing: normal;
              orphans: auto; text-align: start; text-indent: 0px;
              text-transform: none; white-space: normal; widows: auto;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;" class="">Libor
              Krzyžanek</div>
            <div style="color: rgb(0, 0, 0); letter-spacing: normal;
              orphans: auto; text-align: start; text-indent: 0px;
              text-transform: none; white-space: normal; widows: auto;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;" class="">Principal
              Software Engineer<br class="">
              Red Hat Developers | Engineering</div>
          </div>
          <br class="">
          <div>
            <blockquote type="cite" class="">
              <div class="">On Mar 31, 2016, at 3:00 PM, Marek Posolda
                &lt;<a moz-do-not-send="true"
                  href="mailto:mposolda@redhat.com" class="">mposolda@redhat.com</a>&gt;
                wrote:</div>
              <br class="Apple-interchange-newline">
              <div class="">
                <div class="">Followup on the issue by Libor [1] . I can
                  confirm to see the same <br class="">
                  behaviour in the OOTB Keycloak, like Libor described
                  in the JIRA. In <br class="">
                  other words, when you refresh account page ( <br
                    class="">
                  <a moz-do-not-send="true"
                    href="http://localhost:8080/auth/realms/myrealm/account"
                    class="">http://localhost:8080/auth/realms/myrealm/account</a>
                  ) but the UserSession <br class="">
                  referenced from KEYCLOAK_IDENTITY cookie is expired,
                  then all cookies <br class="">
                  including KEYCLOAK_REMEMBERME are expired too.<br
                    class="">
                  <br class="">
                  IMO RememberMe cookie shouldn't be expired when
                  session is expired. <br class="">
                  We're using the rememberMe cookie as hint for username
                  on the login <br class="">
                  page. So even if user returns to page after a month, I
                  am not seeing <br class="">
                  anything bad that rememberMe cookie is still valid and
                  user will see <br class="">
                  "hint" with his username on login page and rememberMe
                  checkbox checked <br class="">
                  even if session was expired already for a long time.
                  IMO the only <br class="">
                  situation when we should expire KEYCLOAK_REMEMBERME
                  cookie is, when user <br class="">
                  unchecks the "Remember me" checkbox on login page.<br
                    class="">
                  <br class="">
                  [1] <a moz-do-not-send="true"
                    href="https://issues.jboss.org/browse/ORG-2956"
                    class="">https://issues.jboss.org/browse/ORG-2956</a><br
                    class="">
                  <br class="">
                  Marek<br class="">
                  _______________________________________________<br
                    class="">
                  keycloak-dev mailing list<br class="">
                  <a moz-do-not-send="true"
                    href="mailto:keycloak-dev@lists.jboss.org" class="">keycloak-dev@lists.jboss.org</a><br
                    class="">
                  <a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-dev">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br
                    class="">
                </div>
              </div>
            </blockquote>
          </div>
          <br class="">
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>