11

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.

biesior
  • 55,576
  • 10
  • 125
  • 182
angelokh
  • 9,426
  • 9
  • 69
  • 139

2 Answers2

15

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

André Santos
  • 326
  • 3
  • 9
9

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.

biesior
  • 55,576
  • 10
  • 125
  • 182