Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CookieClearingLogoutHandler enhancement #6116

Merged
merged 3 commits into from
Nov 26, 2018

Conversation

j0hnc0yne
Copy link
Contributor

@j0hnc0yne j0hnc0yne commented Nov 20, 2018

Enabled the ability to pass in an array of Cookies to support clearing cookies on a different path other than the default context path
Issue: gh-6078

Issue #6078

cc: @rwinch

Enabled the ability to pass in an array of Cookies to support clearing cookies on a different path other than the default context path
Issue: spring-projectsgh-6078
@j0hnc0yne
Copy link
Contributor Author

j0hnc0yne commented Nov 20, 2018

FYI - I wasn't sure what to put in for the @since annotation - so put 5.X - let me know if you want to update this

Copy link
Member

@rwinch rwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @maxcoinage! I have provided feedback inline.

*
* @author Luke Taylor
* @since 3.1
*/
public final class CookieClearingLogoutHandler implements LogoutHandler {
private final List<String> cookiesToClear;
private final List<Object> cookiesToClear;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to List<Function<HttpServletRequest,Cookie>>. In each of the constructors we can convert the arguments into a Function<HttpServletRequest,Cookie>.

}

/**
* @since 5.X
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to 5.2

response.addCookie(cookie);
for (Object cookie : cookiesToClear) {
Cookie realCookie = null;
if (cookie instanceof String) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic will obviously need updated once we change this.cookiesToClear.

Changed the implementation to use an anonymous function
Issue: spring-projectsgh-6078
@j0hnc0yne
Copy link
Contributor Author

@rwinch Thanks for the feedback, I was not too happy with my initial solution and think your proposal is much better PR is now updated, please check at your convenience

@rwinch rwinch added this to the 5.2.0.M2 milestone Nov 26, 2018
@rwinch rwinch self-assigned this Nov 26, 2018
@rwinch rwinch modified the milestones: 5.2.0.M2, 5.2.0.M1 Nov 26, 2018
@rwinch rwinch added in: web An issue in web modules (web, webmvc) type: enhancement A general enhancement labels Nov 26, 2018
@rwinch rwinch added the status: duplicate A duplicate of another issue label Nov 26, 2018
@rwinch rwinch merged commit 7618d23 into spring-projects:master Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants