0

I am seeing strange issue after upgrading spring boot from 0.5.0.M7 to 1.1.9.RELEASE. My application.properties has this property defined


server.session-timeout=60

But now my session gets expired within 1 minute of inactivity. I switch back to previous version and the issue disappears.

I debugged my code to see if ServerProperties.java was setting 60 to sessionTimeout variable inside it. And it indeed did.

Can somebody point me to the direction I should be looking to? What has changed that could cause such an issue?

hellojava
  • 4,904
  • 9
  • 30
  • 38
  • What other input shall I provide in order to get help from community? – hellojava Nov 25 '14 at 06:39
  • Did you needed any configurations? Or did you just added server.session-timeout into properties file? Is this calculation the inactive time or starts when the the session is created? – JayC Apr 28 '17 at 16:01
  • This is basically related to your servlet container session timeout config. In my case its tomcat and it calculates the inactive time. – hellojava Apr 30 '17 at 07:03

1 Answers1

2

http://docs.spring.io/spring-boot/docs/1.1.9.RELEASE/reference/htmlsingle/#appendix The following documentation contains all the properties that you can use in you yml configuration. Here is what it says about the server.session-timeout:

server.session-timeout= # session timeout in seconds

If you want to have 60 minutes timeout then you need to use

server.session-timeout=3600

Hope this helps.

Ilya Ovesnov
  • 4,079
  • 1
  • 27
  • 31
  • That might make sense. But this brings me to think, how did it work before that? Did the spring guys change it from minutes to seconds? This thread talks about minutes for the earlier version: http://stackoverflow.com/questions/24561915/spring-boot-spring-security-session-timeout – hellojava Nov 25 '14 at 07:25
  • Indeed. someone is saying that this is in seconds, someone is saying in minutes. I would rely on the official documentation and that your server is timing out after the specified period in seconds – Ilya Ovesnov Nov 25 '14 at 07:45
  • @hellojava That's the sort of change you should expect when going from a prerelease 0.x milestone to a major GA release. – chrylis -cautiouslyoptimistic- Nov 25 '14 at 09:13
  • 2
    It was a bug in Spring Boot. It was fixed in [this commit](https://github.com/spring-projects/spring-boot/commit/0c0a0a7738121229a2c470be0b6f8fd8e7061d27) – Andy Wilkinson Nov 25 '14 at 09:39