i am trying to set a cookie with TG2 like

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

print "Content-type: text/plain"
            print cookie.output()
            print
            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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.