Cookie를 사용하는 방법이다. (https://www.playframework.com/documentation/2.3.x/ScalaResults)
val result = Ok("Hello world").withCookies(
Cookie("theme", "blue"))
Set
val result2 = result.discardingCookies(DiscardingCookie("theme"))
Discarding
val result3 = result.withCookies(Cookie("theme", "blue")).discardingCookies(DiscardingCookie("skin"))
Set & Discarding
def home(name:String) = Action {request=>
val previousStr = request.cookies.get("test").get.value
Ok("Hello").withCookies(Cookie("test", name))
}
Get
'Development > Web & Server' 카테고리의 다른 글
[Play Framework2] Action composition (0) | 2015.05.23 |
---|---|
[Play Framework2] Session and Flash scopes (0) | 2015.05.22 |
[Play Framework2] Http Routing (0) | 2015.05.19 |
IOException: Cannot run program "javac": java.io.IOException: error=2, No such file or directory (0) | 2015.05.18 |
[Play Framework] 2.3버전 설치 및 프로젝트 생성 (0) | 2015.04.16 |