angelokh
angelokh

Reputation: 9428

Share session/cookie between subdomains for Play 2.X

I only can find Play 1.x has this setting. How to set this in 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.

Upvotes: 11

Views: 3010

Answers (2)

André Santos
André Santos

Reputation: 326

In play 2.4, session.domain has been deprecated. You should now use: play.http.session.domain

Upvotes: 15

biesior
biesior

Reputation: 55798

There was change for that problem pulled into Play 2.1 but unfortunately it wasn't backported to 2.0.x.

That means, that since Play 2.1 you can use in conf:

session.domain=".mydomain.com"

For 2.0.x you need to patch the sources yourself.

Upvotes: 9

Related Questions