Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-5171

DataSourcePersistentManager error with FORM login

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.1.1
    • EAP_EWP 5.1.0_CR3
    • Clustering
    • None
    • Hide

      Setup database persistence as in http://community.jboss.org/wiki/HAWebSessionsviaDatabasePersistence
      Deploy a web application using database persistence and FORM authentication (see attached simpleWebApp.war)
      Access a protected resource, and submit the login form with the correct credentials.

      Expected outcome: requested resource is returned
      Actual outcome: 408 error

      Show
      Setup database persistence as in http://community.jboss.org/wiki/HAWebSessionsviaDatabasePersistence Deploy a web application using database persistence and FORM authentication (see attached simpleWebApp.war) Access a protected resource, and submit the login form with the correct credentials. Expected outcome: requested resource is returned Actual outcome: 408 error
    • Release Notes
    • Hide
      A software error resulted in a situation where neither the process of serving the login page nor handling the
      <code>POST</code> to <code>j_security_check</code> resulted in a call into <code>ClusteredSessionValve</code>,
      which is the part of the request pipeline that triggers replication of the session by storing it in the
      database. <code>FormAuthenticator</code> directly dispatched to the login page, and handled
      <code>j_security_check</code> itself.

      As a result, the session that was created before serving the login page was not persisted. When the
      authentication was complete and the request for the original URL came in, the session manager checked with the
      distributed store to see whether the local session copy was out of date. With
      <code>DataSourcePersistentManager</code>, that check was made to class
      <code>VersionBasedOutdatedSessionChecker</code>. <code>VersionBasedOutdatedSessionChecker</code> returned true
      because it could not find the session in the database. Because of the <code>true</code> return value, the
      session manager could not use the local session. It attempted to read it from the persistent store. It did not
      exist in the persistent store either, so a new session was created.

      To address this issue, <code>VersionBasedOutdatedSessionChecker</code> now checks the session's
      <code>getLastReplicated</code> method if it cannot find a persisted session. If the value is 0, the session is
      new, and has never been persisted, so it cannot be outdated. In that case it returns false.
      Show
      A software error resulted in a situation where neither the process of serving the login page nor handling the <code>POST</code> to <code>j_security_check</code> resulted in a call into <code>ClusteredSessionValve</code>, which is the part of the request pipeline that triggers replication of the session by storing it in the database. <code>FormAuthenticator</code> directly dispatched to the login page, and handled <code>j_security_check</code> itself. As a result, the session that was created before serving the login page was not persisted. When the authentication was complete and the request for the original URL came in, the session manager checked with the distributed store to see whether the local session copy was out of date. With <code>DataSourcePersistentManager</code>, that check was made to class <code>VersionBasedOutdatedSessionChecker</code>. <code>VersionBasedOutdatedSessionChecker</code> returned true because it could not find the session in the database. Because of the <code>true</code> return value, the session manager could not use the local session. It attempted to read it from the persistent store. It did not exist in the persistent store either, so a new session was created. To address this issue, <code>VersionBasedOutdatedSessionChecker</code> now checks the session's <code>getLastReplicated</code> method if it cannot find a persisted session. If the value is 0, the session is new, and has never been persisted, so it cannot be outdated. In that case it returns false.
    • Documented as Resolved Issue

    Description

      When using the DataSourcePersistentManager [1] to store web sessions, submitting a
      FORM login page results in a 408 error because the session is not found.

      The initial request for the protected resource sets the JSESSIONID cookie and returns the login form.
      But the session is not saved in the database, so submitting the form results in a 408 error.

      If the session already exists prior to the request for the protected resource, it works correctly.

      [1] http://community.jboss.org/wiki/HAWebSessionsviaDatabasePersistence

      Attachments

        Issue Links

          Activity

            People

              bstansbe@redhat.com Brian Stansberry
              rhn-support-dereed Dennis Reed
              Misty Stanley-Jones Misty Stanley-Jones (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: