升级到SecureSocial 2.0.12,现在会话不会被持久化

and*_*ewf 6 playframework-2.0 securesocial

我使用的是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'
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?我想知道是否由于某种原因登录cookie在检查现有登录会话之前就已经开始了...

我正在使用用户名/密码验证.

Jor*_*rge 4

用户信息在会话中的存储方式发生了变化。该模块现在使用单独的 cookie,而不是使用 Play 会话 cookie。该 cookie 有一个验证器 ID。用户信息现在存储在服务器端的 AuthenticatorStore 实现中。默认实现使用 Play 缓存,这就是为什么您需要在重新编译时再次进行身份验证。正在清除缓存中的数据。

如果您想在重新编译/重新启动后保持用户登录状态,您可以:

  1. 创建一个持久保存事物的 AuthenticatorStore 实现。
  2. 更改 ehcache.xml 文件以保留在文件系统中 (diskPersistent="true")。

  • 谢谢!刚刚有机会回到这个,看看。实现一个持久保存到我的数据库的 AuthenticatorStore 看起来相当简单。V. 令人烦恼的是,它没有在任何地方记录! (2认同)