Skip to content

Instantly share code, notes, and snippets.

@alexandru
Last active December 17, 2015 16:59
Show Gist options
  • Select an option

  • Save alexandru/5642443 to your computer and use it in GitHub Desktop.

Select an option

Save alexandru/5642443 to your computer and use it in GitHub Desktop.
package object extensions {
import play.api.mvc._
implicit class ResultExtensions(val result: PlainResult)
extends AnyVal {
def withLangCookie(lang: Lang)(implicit app: Application): PlainResult =
result.withCookies(Cookie(Play.langCookieName, lang.code, httpOnly = false))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment