spring-projects / spring-projects/spring-session

After using Filter of spring-session-jdbc session object is empty in later CompositeFilter

Open
#1,413 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Problem Describe(seems timing problem):

After using SpringSessionRepositoryFilter, session object is empty during the processing period of OtherFilter at the begining of every request

What I have tried:
  • In the Controller and JSP after OtherFilter, session object is not empty and works fine
  • Without using springSessionRepositoryFilter, session object is notempty and works fine in OtherFilter
The configuratioin is like below:
<bean class="org.springframework.web.filter.CompositeFilter" name="springChainFilter">
    <property name="filters">
        <list>
            <bean id="springSessionRepositoryFilter" class="org.springframework.session.web.http.SessionRepositoryFilter">
            </bean>

            <!--Other Later Filter -->
            <bean id="otherFilter" class="xxx.xxx.OtherFilter">
            </bean>
        </list>
    </property>
</bean>

<bean class="org.springframework.session.jdbc.config.annotation.web.http.JdbcHttpSessionConfiguration"/>

<bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <constructor-arg ref="dataSource"/>
</bean>

<bean id="cookieSerializer" class="org.springframework.session.web.http.DefaultCookieSerializer">
    <property name="cookieName" value="JSESSIONID" />
</bean>

Environment Version Info:

spring-session-jdbc-2.1.5.RELEASE
wildfly-11.0.0.Final
Oracle Database 18c Express Edition Release 18.0.0.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with org.springframework.session.web.http.SessionRepositoryFilter and org.springframework.web.filter.CompositeFilter, using the provided configuration and environment versions to reproduce the session visibility difference. Compare session state at the beginning of OtherFilter with the controller and JSP behavior; done means the issue is reproduced and the cause or a verified fix is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.