question

shinou-1519 avatar image
0 Votes"
shinou-1519 asked ryanchill answered

springboot session timeout setting in azure app service

my spring boot project worked well with the following setting in the local env.

server.servlet.session.timeout: 180m

but when i released the jar to the azure as app service. session time-out became to a default time(1800s).
request.getSession().getMaxInactiveInterval() = 1800

where can i set the session time in azure, or wheather azure support the setting ?

some one who can give some advice? thanks.

azure-webapps
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@shinou-1519 The 30 minute timeout is a default value for Spring Boot, but this is not modified by Azure Spring Cloud. How was the default overridden? Also, are you using Azure App Service or Azure Spring Cloud?


0 Votes 0 ·

@kobulloc-MSFT
thanks for you answer.
i knew that The 30 minute timeout is a default value for Spring Boot.
i want to know how to override the default 30 minute timeout to 180minute when i released the jar in the Azure As a Azure App Service.

0 Votes 0 ·

@shinou-1519 Thank you for the clarification! Let me update the tag so this can get seen by people who specialize in Azure App Services.

0 Votes 0 ·

@shinou-1519, are you generating a jar or a war file? Is your app service Windows hosted or Linux? Which Java environment runtime is your app service (embedded, Tomcat 8.5 or Tomcat 9)?

0 Votes 0 ·

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered

Hi @shinou,

I'm not sure if you're deploy via .jar or .war but according to this Stackoverflow post, session timeout setting may or may not be used and seems to work when Spring Boot uses an embedded Tomcat as the web container. If you're deploy your app as a WAR file, your setting will not be honored unless a web.xml file is created with a configuration.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.