Skip to content

SEC-2120: Include exception message in logs for IllegalStateException in HttpSessionSecurityContextRepository.SaveToSessionResponseWrapper.createNewSessionIfAllowed() #2345

@spring-projects-issues

Description

@spring-projects-issues

alt250 (Migrated from SEC-2120) said:

IllegalStateException exception message should be logged to allow finding the root cause of hard-to-reproduce issues with session creation in this context.
The reason being that "response has been committed" is not the only possible cause.

Stack trace can also be logged in debug mode.

        try {
            return request.getSession(true);
        } catch (IllegalStateException e) {
            // Response must already be committed, therefore can't create a new session
            logger.warn("Failed to create a session, as response has been committed. Unable to store SecurityContext."); <<< add more information here
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementA general enhancementtype: jiraAn issue that was migrated from JIRA

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions