in pan-domain-auth-play/src/main/scala/com/gu/pandomainauth/action/Actions.scala [198:210]
def generateCookie(authedUser: AuthenticatedUser): Cookie = Cookie(
name = settings.cookieSettings.cookieName,
value = CookieUtils.generateCookieData(authedUser, settings.signingAndVerification),
domain = Some(domain),
secure = true,
httpOnly = true
)
def includeSystemInCookie(authedUser: AuthenticatedUser)(result: Result): Result = {
val updatedAuth = authedUser.copy(authenticatedIn = authedUser.authenticatedIn + system)
val updatedCookie = generateCookie(updatedAuth)
result.withCookies(updatedCookie)
}