Skip to content

Conversation

@vpavic
Copy link
Contributor

@vpavic vpavic commented Apr 10, 2019

Spring Session's own configuration support (i.e. SpringHttpSessionConfiguration) will configure the default DefaultCookieSerializer with rememberMeRequestAttribute if SpringSessionRememberMeServices bean has been detected in the application context.

In contrast, Spring Boot's auto-configured DefaultCookieSerializer does not do this which results in a different out-of-the-box experience for users that rely on Spring Session's remember-me integration.

This PR improves Spring Session DefaultCookieSerializer auto-configuration to match Spring Session's behavior and make the auto-configured DefaultCookieSerializer aware of SpringSessionRememberMeServices bean.

Spring Session's own configuration support (i.e. SpringHttpSessionConfiguration) will configure the default DefaultCookieSerializer with rememberMeRequestAttribute if SpringSessionRememberMeServices bean has been detected in the application context.

In contrast, Spring Boot's auto-configured DefaultCookieSerializer does not do this which results in a different out-of-the-box experience for users that rely on Spring Session's remember-me integration.

This commit improves Spring Session DefaultCookieSerializer auto-configuration to match Spring Session's behavior and make the auto-configured DefaultCookieSerializer aware of SpringSessionRememberMeServices bean.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 10, 2019
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 10, 2019
@philwebb philwebb added this to the 2.2.x milestone Apr 10, 2019
@mbhave
Copy link
Contributor

mbhave commented Apr 16, 2019

Should we do this in 2.1.x?

@vpavic
Copy link
Contributor Author

vpavic commented Apr 16, 2019

I see no issues with that. It's a small change that affects only user the rely on Spring Session's remember-me integration, and for those it feels like a bug. But after all, auto-configuration for DefaultCookieSerializer itself was introduced in a maintenance release (2.0.7.RELEASE).

@philwebb philwebb modified the milestones: 2.2.x, 2.1.x Apr 18, 2019
snicoll pushed a commit that referenced this pull request Apr 19, 2019
Spring Session's own configuration support (i.e.
SpringHttpSessionConfiguration) will configure the default
DefaultCookieSerializer with rememberMeRequestAttribute if
SpringSessionRememberMeServices bean has been detected in the
application context.

In contrast, Spring Boot's auto-configured DefaultCookieSerializer does
not do this which results in a different out-of-the-box experience for
users that rely on Spring Session's remember-me integration.

This commit improves Spring Session DefaultCookieSerializer
auto-configuration to match Spring Session's behavior and make the
auto-configured DefaultCookieSerializer aware of
SpringSessionRememberMeServices bean.

See gh-16513
snicoll added a commit that referenced this pull request Apr 19, 2019
* pr/16513:
  Polish "Improve DefaultCookieSerializer auto-configuration"
  Improve DefaultCookieSerializer auto-configuration
@snicoll snicoll self-assigned this Apr 19, 2019
@snicoll snicoll modified the milestones: 2.1.x, 2.1.5 Apr 19, 2019
@snicoll snicoll closed this in 7b94718 Apr 19, 2019
@snicoll
Copy link
Member

snicoll commented Apr 19, 2019

Thanks @vpavic. I've polished your contribution in 7b94718 - Please note we've reviewed the auto-configuration to avoid having a constructor when a given dependency is used in one place. Rather, we put that in the @Bean definition itself so that the context does not have to resolve it if the bean doesn't have to be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants