Search code examples
djangoemailcookiesdouble-quotes

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)

Solution

  • You can try strip method

    email.strip('"')