Cookies

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 58
Reputation: adam291086 is an unknown quantity at this point 
Solved Threads: 0
adam291086 adam291086 is offline Offline
Junior Poster in Training

Cookies

 
0
  #1
Sep 30th, 2009
i am trying to set a cookie with TG2 like

  1. cookie = Cookie.SimpleCookie()
  2. cookie["ADAM-TEST"] = "random.randint(1000000000)"
  3. cookie["ADAM-TEST"]["domain"] = ".jayconrod.com"
  4. cookie["ADAM-TEST"]["path"] = "/"
  5. cookie["ADAM-TEST"]["expires"] = \
  6. expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST")


When i do the following

  1. print "Content-type: text/plain"
  2. print cookie.output()
  3. print
  4. 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?
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 107
Reputation: ov3rcl0ck is an unknown quantity at this point 
Solved Threads: 12
ov3rcl0ck ov3rcl0ck is offline Offline
Junior Poster

Re: Cookies

 
0
  #2
Sep 30th, 2009
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.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC