<Forwarding to the list> ----- Original Message ----- From: "federico ramirez" <[EMAIL PROTECTED]> To: "Alan Gauld" <[EMAIL PROTECTED]> Sent: Monday, September 18, 2006 12:43 AM Subject: Re: [Tutor] i just cant do it
> Nope...sorry i tried what they said in that article but it didnt > work :( >>_< > > 2006/9/17, Alan Gauld <[EMAIL PROTECTED]>: >> >> >> > Sorry, in the first code i set the cookie and then display it but >> > in >> > the >> > second i assume that the cookie is created and just want to read >> > it, >> > but >> > nothing happens >> >> Correct. >> I notice Luke also sent a reply. >> >> Between the two replies do you understand what you now need to do >> differently in the second case to recreate the cookie from its >> file? >> >> Alan G. >> >> >> > #!/usr/bin/python >> >> > >> >> > import Cookie >> >> > C = Cookie.SimpleCookie() >> >> > C['adminuser'] = 'fedekiller' >> >> > C['adminuser']['max-age'] = 60*60*24*7 >> >> > print C >> >> > print "Content-Type: text/html\n\n" >> >> > print "Bienvenido",C['adminuser'].value,'!' >> >> > >> >> > >> >> > but when i try this it doesnt >> >> >> >> Can you explain why you think it should work? >> >> What do yopu think it is doing? >> >> The code below is very obviously completely different to >> >> the code above, so what makes you think it should work? >> >> >> >> > #!/usr/bin/python >> >> > >> >> > import Cookie >> >> > print "Content-Type: text/html\n\n" >> >> > print "Bienvenido",C['adminuser'].value,'!' >> >> >> >> What is C? Where is it defined? >> >> >> >> > i know the cookie exists because firefox display it where >> >> > all the cookies of that domains are. >> >> >> >> Cookies exist as small files on your PC. A Python program >> >> needs to be given a clue as to which cookie you are interested >> >> in so that it can access that file. That's what the Cookie >> >> module >> >> helps you to do, but it needs to be more than simply imported. >> >> That just makes the tools available, it doesn't actually turn >> >> them on. >> >> >> >> HTH, >> >> >> >> Alan G. >> >> >> > >> > >> > >> > -- >> > Best Regards. >> > fedekiller >> > >> >> > > > -- > Best Regards. > fedekiller > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor