Sanic: [question] How to set 'SameSite' header to 'Strict' in response.cookie ?

Created on 9 Dec 2017  路  3Comments  路  Source: sanic-org/sanic

Hello.

Sorry, I had not figured out, how to set cookie, which I wan't to send in response to 'Strict' mode ?

_Offtop:
Is there some IRC channed or something like this dedicated to Sanic ?_

Thank you.
Best regards,
Vladislav

Most helpful comment

_Offtopic: I have created #sanic on freenode, I didn't find anything else either.
chat.freenode.net:6697 / non-SSL: 6667
If someone from this project wants to take over please message me_

All 3 comments

_Offtopic: I have created #sanic on freenode, I didn't find anything else either.
chat.freenode.net:6697 / non-SSL: 6667
If someone from this project wants to take over please message me_

Well it needed a PR 馃檮 This should do it afterwards though:

from sanic.response import text

@app.route("/")
async def test(request):
    response = text("There's a cookie up in this response")
    response.cookies['hello'] = 'world'
    response.cookies['hello']['samesite'] = 'strict'
    return response

@r0fls, thank you very much =)

I thought, that, maybe, there is a way to add custom headers. Like by modification request instance, but I'm not familiar with it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rainyear picture rainyear  路  3Comments

ubergarm picture ubergarm  路  4Comments

olalonde picture olalonde  路  3Comments

1067511899 picture 1067511899  路  3Comments

eseglem picture eseglem  路  4Comments