{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-session/issues/110","labels_url":"https://api.github.com/repos/spring-projects/spring-session/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-session/issues/110/comments","events_url":"https://api.github.com/repos/spring-projects/spring-session/issues/110/events","html_url":"https://github.com/spring-projects/spring-session/issues/110","id":54427175,"number":110,"title":"easier configuration of session timeout","user":{"login":"NoUsername","id":494584,"avatar_url":"https://avatars.githubusercontent.com/u/494584?v=3","gravatar_id":"","url":"https://api.github.com/users/NoUsername","html_url":"https://github.com/NoUsername","followers_url":"https://api.github.com/users/NoUsername/followers","following_url":"https://api.github.com/users/NoUsername/following{/other_user}","gists_url":"https://api.github.com/users/NoUsername/gists{/gist_id}","starred_url":"https://api.github.com/users/NoUsername/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoUsername/subscriptions","organizations_url":"https://api.github.com/users/NoUsername/orgs","repos_url":"https://api.github.com/users/NoUsername/repos","events_url":"https://api.github.com/users/NoUsername/events{/privacy}","received_events_url":"https://api.github.com/users/NoUsername/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-15T09:16:35Z","updated_at":"2015-01-15T15:59:17Z","closed_at":null,"body":"currently the session timeout can be set via the `@EnableRedisHttpSession(maxInactiveIntervalInSeconds=3600)` annotation\r\n\r\nhowever this value will often be externalized (as it is already with spring boot applications in the `server.session-timeout` property.\r\n\r\nit would be nice to have an easy way to configure this more dynamically. either via allowing a spring-expression in the annotation or by providing a simple setter on a bean that can be auto-injected and customized somewhere"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-session/issues/comments/70107881","html_url":"https://github.com/spring-projects/spring-session/issues/110#issuecomment-70107881","issue_url":"https://api.github.com/repos/spring-projects/spring-session/issues/110","id":70107881,"user":{"login":"rwinch","id":362503,"avatar_url":"https://avatars.githubusercontent.com/u/362503?v=3","gravatar_id":"","url":"https://api.github.com/users/rwinch","html_url":"https://github.com/rwinch","followers_url":"https://api.github.com/users/rwinch/followers","following_url":"https://api.github.com/users/rwinch/following{/other_user}","gists_url":"https://api.github.com/users/rwinch/gists{/gist_id}","starred_url":"https://api.github.com/users/rwinch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwinch/subscriptions","organizations_url":"https://api.github.com/users/rwinch/orgs","repos_url":"https://api.github.com/users/rwinch/repos","events_url":"https://api.github.com/users/rwinch/events{/privacy}","received_events_url":"https://api.github.com/users/rwinch/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T15:59:17Z","updated_at":"2015-01-15T15:59:17Z","body":"At the moment I don't really see this as being a common use case. I'm hesitant to introduce additional complexity without a popular usecase(s). Perhaps if you explain your use case I will better understand.\r\n\r\nThe way in which you would do this currently is by providing your own SessionRepository and ensuring to mark it as `@Primary`. For example:\r\n\r\n```java\r\n@RedisHttpSessionConfiguration\r\npublic class HttpSessionConfig {\r\n    @Value(\"${server.session-timeout}\")\r\n    private int maxInactiveIntervalInSeconds;\r\n\r\n    @Primary\r\n    @Bean\r\n    public RedisOperationsSessionRepository sessionRepository(RedisTemplate<String, ExpiringSession> sessionRedisTemplate) {\r\n        RedisOperationsSessionRepository sessionRepository = new RedisOperationsSessionRepository(sessionRedisTemplate);\r\n        sessionRepository.setDefaultMaxInactiveInterval(maxInactiveIntervalInSeconds);\r\n        return sessionRepository;\r\n    }\r\n}\r\n```"}}