Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#142] added Http.Cookie.defaultDomain to enable sharing session/cook…
…ies between multiple sub-domains
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package play.mvc; | ||
|
||
import org.junit.Test; | ||
import static org.fest.assertions.Assertions.assertThat; | ||
|
||
public class HttpResponseTest { | ||
|
||
@Test | ||
public void verifyDefaultCookieDomain() { | ||
Http.Cookie.defaultDomain = null; | ||
Http.Response response = new Http.Response(); | ||
response.setCookie("testCookie", "testValue"); | ||
assertThat(response.cookies.get("testCookie").domain).isNull(); | ||
|
||
Http.Cookie.defaultDomain = ".abc.com"; | ||
response = new Http.Response(); | ||
response.setCookie("testCookie", "testValue"); | ||
assertThat(response.cookies.get("testCookie").domain).isEqualTo(".abc.com"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters