question

82549142 avatar image
0 Votes"
82549142 asked Grmacjon-MSFT commented

Spring Boot session is not created in Azure

When we deploy our Spring Boot app to Azure Web App, the JSESSIONID cookie is not created, and it looks like there is no session at all.

This is our Spring Security session config:

 private void setSessionManagement(HttpSecurity http) throws Exception {
         http.sessionManagement()
                 .enableSessionUrlRewriting(false)
                 .sessionFixation()
                 .migrateSession()
                 .sessionCreationPolicy(SessionCreationPolicy.ALWAYS)
                 .invalidSessionStrategy(invalidSessionStrategy);
                 //.maximumSessions(1)
                 //.expiredSessionStrategy(expiredSessionStrategy);
     }

When we run in locally in Docker/IntelliJ, it is created. Besides this, I have already set the ARR affinity 'On' under the Configuration > General settings, but still no luck.

azure-webappsazure-spring-cloud
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.

1 Answer

82549142 avatar image
0 Votes"
82549142 answered Grmacjon-MSFT commented

Found the issue, we had to update Spring Boot: 2.3.5.RELEASE -> 2.5.4

· 1
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.

Thanks for the updated. Glad you were able to resolve your issue.

0 Votes 0 ·