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

Session fetched for static assets #171

Open
markosski opened this issue May 10, 2024 · 3 comments · May be fixed by #206
Open

Session fetched for static assets #171

markosski opened this issue May 10, 2024 · 3 comments · May be fixed by #206
Assignees
Labels
info: good first issue Good for newcomers type: improvement A minor improvement to an existing feature

Comments

@markosski
Copy link

markosski commented May 10, 2024

Issue description

Hello all! I noticed that some static assets get the session cookie returned in response. I have a custom implementation of session storage that stores data in database (instead of in-memory) and this behavior adds unnecessary load onto the database. I tested with default in memory session storage and the behavior is the same.
Not sure if this is configuration issue or possibly a bug?

image image image
@markosski
Copy link
Author

Looking through the code HttpSessionFilter execute on each request. I created the following to override this. Is this reasonable?

@Filter(patternStyle = FilterPatternStyle.REGEX, patterns = "(?!\\/static\\/).+")
@Replaces(HttpSessionFilter.class)
public class SessionFilter extends HttpSessionFilter {
    public SessionFilter(SessionStore<Session> sessionStore, HttpSessionIdResolver[] resolvers, HttpSessionIdEncoder[] encoders) {
        super(sessionStore, resolvers, encoders);
    }
}

@sdelamo
Copy link
Contributor

sdelamo commented Oct 28, 2024

yes, it is reasonable. We should make it configurable.

@sdelamo sdelamo added the type: improvement A minor improvement to an existing feature label Oct 28, 2024
@sdelamo sdelamo added the info: good first issue Good for newcomers label Oct 28, 2024
@sdelamo
Copy link
Contributor

sdelamo commented Oct 28, 2024

@sdelamo sdelamo removed this from 4.7.0 Release Nov 8, 2024
@sdelamo sdelamo linked a pull request Dec 11, 2024 that will close this issue
@sdelamo sdelamo moved this to Ready for Review in 4.8.0 Release Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info: good first issue Good for newcomers type: improvement A minor improvement to an existing feature
Projects
Status: Ready for Review
Development

Successfully merging a pull request may close this issue.

3 participants