Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 951
angelokh Avatar asked Feb 05 '13 03:02

angelokh


2 Answers

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

like image 91
André Santos Avatar answered Sep 30 '22 13:09

André Santos


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.

like image 38
biesior Avatar answered Sep 30 '22 13:09

biesior