10

我只能找到 Play 1.x 有这个设置。如何在 Play 2.X 中进行设置?

http://www.playframework.org/documentation/1.2.4/configuration

application.defaultCookieDomain

启用子域之间的会话/cookie 共享。例如,要使 cookie 对所有以 '.example.com' 结尾的域有效,例如 foo.example.com 和 bar.example.com:

application.defaultCookieDomain=.example.com 默认值:cookie 仅对特定域有效。

4

2 回答 2

15

在 play 2.4 中,session.domain已被弃用。您现在应该使用:play.http.session.domain

于 2015-12-22T15:11:47.623 回答
9

该问题发生了变化,Play 2.1不幸的是它没有向后移植到2.0.x.

这意味着,从 Play 2.1 开始,您可以在 conf 中使用:

session.domain=".mydomain.com"

因为2.0.x您需要自己修补源。

于 2013-02-06T05:18:42.590 回答