Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Flask set cookie for both example.com and www.example.com

I'm trying to return a response that sets a cookie for example.com and www.example.com. I've only been able to set the cookie for the domain the request originates from. Can someone point me in the right direction?

like image 823
nathancahill Avatar asked Jun 03 '12 06:06

nathancahill


1 Answers

Ah! set_cookie() has a domain parameter.

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

Problem solved.

like image 132
nathancahill Avatar answered Dec 30 '22 11:12

nathancahill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!