[Flask] Jeff Levesque: flask 'session' via POST

Ritesh Nadhani riteshn at gmail.com
Thu Oct 19 18:28:37 EDT 2017


We are using flask-session backed by Redis.

Our tests are really more:

resp = requests.post('/api/ogin', ...)

cookies = resp.cookies

requests.post('/api/foo', cookies=cookies)

.... somethingh like that pattern.

On Thu, Oct 19, 2017 at 3:23 PM, Jeffrey Levesque
<jeff1evesque at yahoo.com> wrote:
> Hi Ritesh,
> Are you by chance using the generic 'session' module from flask, or 'flask-session'? I need to find the syntax, to query the returned cookie, when using 'from flask import session'.
>
> Thank you,
>
> Jeff Levesque
> https://github.com/jeff1evesque
>
>> On Oct 19, 2017, at 6:07 PM, Ritesh Nadhani <riteshn at gmail.com> wrote:
>>
>> Yes.
>>
>> This is kind of what we are doing at my current place for our tests
>> etc. We just send back the same cookie that we get after login to any
>> further request using the requests/httpie combination.
>>
>> On Thu, Oct 19, 2017 at 1:04 PM, Jeffrey Levesque via Flask
>> <flask at python.org> wrote:
>>> Hi guys,
>>> Wondering if flask authentication (i.e. 'from flask import session'), will return a cookie back to the client (non-browser), if the client sent a custom post request. If this is possible, can the same client, on successive post request, provide that same cookie (given to them from the first POST request they made) to maintain the status of being authenticated (logged in), if they send a successive custom POST request, not through a traditional browser action?
>>>
>>> Thank you,
>>>
>>> Jeff Levesque
>>> https://github.com/jeff1evesque
>>> _______________________________________________
>>> Flask mailing list
>>> Flask at python.org
>>> https://mail.python.org/mailman/listinfo/flask
>>
>>
>>
>> --
>> Ritesh
>



-- 
Ritesh


More information about the Flask mailing list