Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Stackorigin – The Community of Question and Answers

Stackorigin – The Community of Question and Answers Logo Stackorigin – The Community of Question and Answers Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question
Home/ Questions/Q 14313
Next
Closed
hari
  • 0
hari
Asked: August 24, 20212021-08-24T20:42:17+00:00 2021-08-24T20:42:17+00:00In: Programming

How to set or get a cookie value in django

  • 0

How to set or get a cookie value in django

cookiesdjango
  • 1 1 Answer
  • 59 Views
  • 0 Followers
  • 0
Share
  • Facebook

    Related Questions

    • Best REST API Books in 2022
    • How Check Java Version In Windows
    • how to create an IAM user in AWS
    • Error message "Forbidden You don't have permission to access / on this server"
    • Unable to delete S3 bucket
    • Check javascript version
    • How much data can I store in a Python dictionary
    • Best JSON viewer Tools Compared for Developers
    • 5 Essential Skills Every Web Developer should Know
    • Python - List Comprehension

    Sorry this question is closed.

    1 Answer

    • Voted
    • Oldest
    • Recent
    1. Best Answer
      arjun
      2021-08-24T20:45:33+00:00Added an answer on August 24, 2021 at 8:45 pm
      This answer was edited.

      to set or get a cookie value in django:

      if request.method=="GET":
          tutorial =  request.COOKIES.get('car_type', 'Saab')
          return render(request, 'cookies/cookie.html')
      elif request.method =="POST":
          payment_id = request.POST.get('cars', '')
          # response = HttpResponse("Cookie Set for Cars")
          response = render(request, 'cookies/cookie.html')
          response.set_cookie('car_type', str(payment_id),max_age=30)
          return response
      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Sidebar

    Ask A Question

    Recent Posts

    • thestackorigin@gmail.com

      How to Download and Install Postman on Windows

      • 0 Comments
    • thestackorigin@gmail.com

      How to Install Angular on Windows

      • 0 Comments
    • thestackorigin@gmail.com

      Get list of IAM users and their groups, policies using ...

      • 0 Comments
    • thestackorigin@gmail.com

      Python Sending Email using SMTP

      • 0 Comments
    • thestackorigin@gmail.com

      Bitbucket Cloud recently stopped supporting account passwords for Git authentication

      • 0 Comments

    Adv 120x600

    Looking for advertising?

    Adv 120x600

    Looking for advertising?
    • Random
    • Answers
      • On: June 25, 2021
      • Answer: 1

      What will be the price of Jio phone next?

      • On: December 27, 2021
      • Answer: 1

      What is the difference between py and pyc files in ...

      • On: March 20, 2021
      • Answers: 0

      When is International Happiness Day Celebrated?

      • On: August 6, 2022
      • Answers: 0

      purchase Generic Estradiol Valerate Italy, Estradiol

      • On: March 23, 2022
      • Answers: 0

      What are oil absorbent pads made up of?

    • sam
      sam added an answer I understand this issue is resolved but I happened to… August 10, 2022 at 2:28 am
    • sam
      sam added an answer If you are using a WAMP server then try this: Single click… August 10, 2022 at 2:26 am
    • Jagadeeshp
      Jagadeeshp added an answer I successfully deleted my bucket by changing the "Action": "Deny"… August 10, 2022 at 2:20 am
    • Jagadeeshp
      Jagadeeshp added an answer Unable to delete S3 bucket You are not able to… August 10, 2022 at 2:19 am
    • jacknilles
      jacknilles added an answer Why make edible glitter, buy Magic Sparkles edible glitters that… August 5, 2022 at 10:21 am

    Adv 120x600

    Looking for advertising?

    Trending Categories

    Health
    1996Questions
    , 3Followers
    Programming
    938Questions
    , 0Followers
    Technology
    212Questions
    , 3Followers
    General Knowledge
    131Questions
    , 0Followers
    Business & Finance
    82Questions
    , 4Followers

    Stats

    • Questions 3k
    • Answers 1k
    • Best Answers 90
    • Users 90

    Explore

    • Recent Questions
    • Most Answered
    • Answers
    • No Answers
    • Most Visited
    • Most Voted
    • Random
    • Polls

    Footer

    Stackorigin - The Community of Question and Answers

    Discy

    Stackorigin is the world’s largest Q&A networking site, Stackorigin community brings you the collaboration of all the various Questions and the related Answers given by the community.

    About

    • About Us
    • Contact Us
    • FAQ
    • Submit Guest Post Article on Technology, Education, Health, Apps, Gadgets, IoT, AI, Business, Digital Marketing and More

    Info

    • Privacy Policy
    • Terms and Conditions
    • Community Guidelines
    • Tags

    Products

    • Tutorials
    • Advertising
    • Categories
    • Corona
    • StackHow

    Follow

    © 2022 Stackorigin. All Rights Reserved.