我只能找到 Play 1.x 有这个设置。如何在 Play 2.X 中设置?
http://www.playframework.org/documentation/1.2.4/configuration
application.defaultCookieDomain
Enables session/cookie sharing between subdomains. For example, to make cookies valid for all domains ending with ‘.example.com’, e.g. foo.example.com and bar.example.com:
application.defaultCookieDomain=.example.com Default: a cookie is only valid for a specific domain.
最佳答案
该问题发生了变化 pulled into Play 2.1
但不幸的是它没有被反向移植到 2.0.x
.
这意味着,从 Play 2.1 开始,您可以在 conf 中使用:
session.domain=".mydomain.com"
对于
2.0.x
您需要自己修补源。
关于playframework - 在 Play 2.X 的子域之间共享 session /cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14699490/