【发布时间】:2013-05-18 14:24:57
【问题描述】:
我使用的是 SecureSocial 2.0.7,我实现了 UserServicePlugin,用户可以登录。我可以停止并重新启动服务器(或重新编译或其他),用户将保持登录状态。
自从升级到 2.0.12 后,登录会话不会在服务器重新启动后保持不变。
我在UserServicePlugin 中的每个方法中都添加了调试日志记录。用户在登录时是saved。但是,当服务器重新启动,并且我尝试以以前登录的用户身份访问页面时,我只会在日志中看到:
[info] play - database [default] connected at jdbc:postgresql://localhost/xxxxxx
[info] application - [securesocial] loaded templates plugin: sec.SecureSocialViews
[info] play - Starting application default Akka system.
[info] application - [securesocial] loaded user service: class sec.LoginUserService
[info] application - [securesocial] loaded password hasher bcrypt
[info] application - [securesocial] loaded identity provider: userpass
[info] play - Application started (Dev)
[debug] application - [securesocial] calling deleteExpiredTokens()
[debug] application - deleteExpiredTokens
[debug] application - [securesocial] anonymous user trying to access : '/supplier/requests'
有什么想法吗?我想知道是否由于某种原因,登录 cookie 甚至在检查现有登录会话之前就被核爆了……
我正在使用用户名/密码验证。
【问题讨论】:
-
这可能与 SecureSocial 将内容存储在 Play Cache 中有关吗? (我只是使用默认的内存播放缓存。)
-
我在 Play 2.1 和 Master 分支 Securesocial 上也发现了这一点。我有一个由数据库支持的用户服务,并已将 ehcache 配置为持久保存到磁盘。但是,重新启动服务器时,所有用户都将注销。令人沮丧。
标签: playframework-2.0 securesocial