[akka-http] adding cookie attributes

111 views
Skip to first unread message

Christophe Pache

unread,
Aug 14, 2017, 4:31:11 AM8/14/17
to Akka User List
Hello everyone!

I'm trying to add a sameSite attribute to cookies using the scaladsl and it looks like the Cookie API is quite closed. What I would like to do is something like 
`Set-Cookie: key=value; HttpOnly; SameSite=strict`
My feeling is that the only current way to do so is to craft a header with something like 
`RawHeader("Set-Cookie", "key=value; HttpOnly; SameSite=strict")`
If so, what about adding attributes to cookie header?

Thanks for any comment on that! Have a nice akking day!
Christophe

johannes...@lightbend.com

unread,
Aug 15, 2017, 11:57:33 AM8/15/17
to Akka User List
Hi Christophe,

yes, that's correct. There seems to be no way to model custom cookie attributes right now. Using RawHeader is the right workaround for now. I filed https://github.com/akka/akka-http/issues/1354 to discuss improvements.

Johannes
Reply all
Reply to author
Forward
0 new messages