Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

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 a 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

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:09:11+00:00 2026-06-16T16:09:11+00:00

Using python shell >>> import requests >>> cookies = {‘sentcookie’:’666′} >>> res = requests.get(‘http://en.wikipedia.org/wiki/Main_Page’,

  • 0

Using python shell

>>> import requests
>>> cookies = {'sentcookie':'666'}
>>> res = requests.get('http://en.wikipedia.org/wiki/Main_Page', cookies=cookies)
>>> res   
<Response [200]>
>>> res.cookies
<<class 'requests.cookies.RequestsCookieJar'>[Cookie(version=0, name='sentcookie', 
value='666', port=None, port_specified=False, domain='', domain_specified=False, 
domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=None,  
discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False)]>
>>>

Why is ‘sentcookie’ included in the cookies list returned from the server? I’ve sniffed the communication and no cookie is returned from the server.
Why does requests include it in the list and how can I disable this behavior?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:09:12+00:00Added an answer on June 16, 2026 at 4:09 pm

    I have the exact same problem and I don’t think I fully understand your answer.
    Assuming you want to add cookies to your request according to the documentation
    this is the right way to do that:

    cookies = {'sentcookie':'666'}
    response = requests.get('http://en.wikipedia.org/wiki/Main_Page', cookies=cookies)
    

    Now if the server returns cookies you can access them by:

    response.cookies 
    

    But I don’t expect to get the same cookies that I have sent even if the server didn’t returned them, for some reason it’s happening.

    How I can to prevent this behavior?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Beautiful Soup works in the Python shell using Django. I can also successfully import
I'm using the Python Shell in this way: >>> s = 'Ã' >>> s
I am using the Google Appengine remote shell, with Python. I am walking through
Using Python module re, how to get the equivalent of the \w (which matches
i am using the python shell to try to do debugging i set a
I've been trying to consume the Twitter Streaming API using Python Requests. There's a
In browser I get: Request URL: http://xxxxxx:8000/person/test/ Using the URLconf defined in person.urls, Django
I am debugging some python code in emacs using pdb and getting some import
I'm trying add some shell extensions using python with icons and a sub menu
Using Python 2.7.3 on Linux. Here is a shell session verbatim. >>> f =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.