Share session/cookie between subdomains for Play 2.X
Asked Answered
M

2

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.

Matriculate answered 5/2, 2013 at 3:0 Comment(0)
G
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.

Glennglenna answered 6/2, 2013 at 5:18 Comment(0)
D
15

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

Diaphanous answered 22/12, 2015 at 15:11 Comment(0)
G
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.

Glennglenna answered 6/2, 2013 at 5:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.