473,411 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to correctly set a cookie value in headers

Maybe you will help me in this "simple" case:

Expand|Select|Wrap|Line Numbers
  1. request2 = urllib.request.Request(url)
  2. cj2 = http.cookiejar.CookieJar()
  3. urlOpener2 = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj2))
  4. url2 = urlOpener2.open(request2)
  5. allinfo2 = url2.info()
Output of this script is on this image: http://img195.imageshack.us/img195/9...0523110058.png My question is: How I can add new element to headers ?? something like that ('Set-Cookie',"server=2")
May 23 '12 #1
0 1402

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Carl | last post by:
Hi, I want to pass the value of the cookie created in VB to ASP. This doesn't work. Any idea? Thanks Carl .... <script language=vbscript> document.cookie="mycookie" '...
2
by: terry | last post by:
Hi, When I store cookie value "12:05:33" and read it again, I find the value become "12%3A05%3A33", how to read or convert it correctly? Thanks!
1
by: Display Name | last post by:
Used one of these canned scripts to set up a JS quiz but not before having used another canned PHP script for "Tell your friend about this Web page!" sort of thing. Now i've gotta integrate them;...
0
by: Kevin | last post by:
Hello, all experts: May I ask you some questions? First, i'm programming a software of auto-authentication by using VB.NET tool. This software's functions is similar to do the account login...
0
by: JT | last post by:
I posted a question earlier about communicating between a javascript function and vb.net. In the end I decided to try using a cookie. I use the following javascript function (from vb.net) to set...
3
by: korque | last post by:
Hi I'm gathering information from web page, first I get headers and store recieved cookies then I get source with file()-function. Is there easy way to send cookie value back to host on each...
1
by: rajunarender01 | last post by:
hi i am working with the usercontrol and want to update the cookie value in the user control how to do it
0
by: javaBookWorm | last post by:
203.114.10.66 - - "GET...
3
by: webster5u | last post by:
Miss/Mr. Programmer, I have a idea to remove the cookie value from a website after all browser closed. It is like session kept in server and eliminate after all browser closed. My purpose is...
2
by: ramuksasi | last post by:
Hi, I am unable to read a cookie value from the cookies. i have set cookie value from javascript in scripting side and try to read cookie value from coding part ie. default.aspx.vb. i have shown...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.