Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django cookies place double quotes around email address

On my login script it creates a cookie for the user logging in of their email address and password. Problem I am having is when the email address is set it puts the entire email address between double quotes. How would I get it to not?

if request.method == 'POST':
     post = request.POST
     email = post.get('email', None)
     response.set_cookie('emailaddress', email, max_age=expire_v)
like image 863
Bobby Avatar asked Sep 06 '25 03:09

Bobby


1 Answers

You can try strip method

email.strip('"')
like image 181
errx Avatar answered Sep 07 '25 21:09

errx