Python Flask sets a cookie for example.com and www.example.com.

I am trying to return a response that sets a cookie for example.com and www.example.com. I was only able to set a cookie for the domain from which the request was received. Can someone point me in the right direction?

+4
source share
1 answer

Oh! set_cookie () has a domain parameter.

response.set_cookie('name', 'value', domain='.example.com') 

The problem is resolved.

+11
source

Source: https://habr.com/ru/post/1415791/


All Articles