Skip to content

Document How to Use Custom sessionRepository with @EnableRedisHttpSessionConfiguration #114

Open
@rwinch

Description

@rwinch
@EnableRedisHttpSessionConfiguration
public class HttpSessionConfig {
    @Value("${server.session-timeout}")
    private int maxInactiveIntervalInSeconds;

    @Primary
    @Bean
    public RedisOperationsSessionRepository sessionRepository(RedisTemplate<String, ExpiringSession> sessionRedisTemplate) {
        RedisOperationsSessionRepository sessionRepository = new RedisOperationsSessionRepository(sessionRedisTemplate);
        // customize
        sessionRepository.setDefaultMaxInactiveInterval(maxInactiveIntervalInSeconds);
        return sessionRepository;
    }
}

Related Issues #110

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: docsAn issue in Documentation or samples

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions