我做了一个API服务器提供给手机端调用,用Spring Session连接Redis来做多台tomcat的session共享,用security来做API的权限拦截,并且使用了x-auth-token也就是header的token验证。现在遇到一个问题,有一些API是无权限验证的,但访问这些API时,spring会为每次request都创建session,返回一个新的x-auth-token,这样可能会导致session过多,请问如何配置才能让这种情况无需创建session呢?已经配置create-session="never",但不管用。以下是security配置
spring session
...
省略redis pool配置
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
Following the voice in heart.