You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot部署至Azure Web App后JSESSIONID未生成、session无法创建问题咨询

Spring Boot部署Azure Web App无法生成JSESSIONID会话问题说明

问题现象

将Spring Boot应用部署到Azure Web App时,未生成JSESSIONID cookie,服务端未创建任何会话。该应用在本地Docker/IntelliJ环境运行时会话创建逻辑完全正常,且已在Azure平台配置>通用设置中开启ARR affinity,问题仍未解决。

关联Spring Security会话配置

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

根因与解决方案

  • 该问题由Spring Boot版本兼容性导致,复现版本为2.3.5.RELEASE
  • 解决方案:直接将Spring Boot版本升级至2.5.4即可修复该会话创建异常

内容的提问来源于stack exchange,提问作者Adam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.03 19:45:02