| | |
Cookies
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2008
Posts: 58
Reputation:
Solved Threads: 0
i am trying to set a cookie with TG2 like
When i do the following
i get the cookie printed out. But when i check the browsers cookies i get nothing. I need the cookie to be set within the browsers cookies. What am i missing?
Python Syntax (Toggle Plain Text)
cookie = Cookie.SimpleCookie() cookie["ADAM-TEST"] = "random.randint(1000000000)" cookie["ADAM-TEST"]["domain"] = ".jayconrod.com" cookie["ADAM-TEST"]["path"] = "/" cookie["ADAM-TEST"]["expires"] = \ expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST")
When i do the following
Python Syntax (Toggle Plain Text)
print "Content-type: text/plain" print cookie.output() print "Cookie set with: " + cookie.output()
i get the cookie printed out. But when i check the browsers cookies i get nothing. I need the cookie to be set within the browsers cookies. What am i missing?
•
•
Join Date: Sep 2009
Posts: 107
Reputation:
Solved Threads: 12
Are you sure the cookie gets put into your browser, because im pretty sure cookielib is for use with urllib/2 and httplib. However you could probably save a cookie in the right format to your browsers cookie cache. I might be wrong, but i doubt cookielib has anything to do with your Web Browser, once again its for use with HTTPlib and urllib 1 and 2.
![]() |
Similar Threads
- News Story: Google to Force-Feed More Cookies (Pay-Per-Click Advertising)
- Netscape 7.1, Hotmail login problem - cookies 'disabled" (Windows NT / 2000 / XP)
- Where do Cookies come from? (Web Browsers)
- how can i used session and cookies ??? (PHP)
- Help me trouble with saving cookies win xp (Windows NT / 2000 / XP)
- Troubles with cookies win. xp (Windows NT / 2000 / XP)
- Cookies makers? (HTML and CSS)
Other Threads in the Python Forum
- Previous Thread: opening an exe from Program Files directory in windows
- Next Thread: Read a line from a txt file
| Thread Tools | Search this Thread |
accessdenied advanced apache application argv beginner change command csv def dictionary dynamic edit enter event examples file float format function google gui homework import inches input jaunty java keyboard lapse library line lines linux list lists loop microphone mouse movingimageswithpygame mysql newb number numbers numeric obexftp output parameters parsing path phonebook port prime programming projects py2exe pygame pygtk pyopengl python random recursion redirect remote return reverse scrolledtext session simple skinning smtp software sprite statictext stderr string strings syntax table tennis terminal text thread threading time tkinter tlapse trick tuple tutorial ubuntu unicode unit urllib urllib2 variable voip windows wordgame wxpython





