From: Jay L. <js...@js...> - 2001-08-08 23:35:22
|
Once you call response.addCookie(), you're done. Gary Perez wrote: >Hi, all. > >Kicking OneShot.cgi around a bit, and I'm doing okay for now except I >can't seem to figure out how to set a cookie that gets written to the >client's cookie file. > >I've been through the modules, trying to construct the right body for my >method (whose class subclasses only 'Page'). Here are relevant (and >probably incorrectly-used) parts of the module for your perusal: > >from Webkit.Page import Page >from WebKit.Cookie import Cookie >from Webkit.HTTPResponse import HTTPResponse > >class FormHandler(Page): > def setACookie(self): > astiCookie = Cookie('astiuid', 12345) > astiCookie.setComment('Your unique ASTi ID') > astiCookie.setDomain('asti-usa.com') > astiCookie.setPath('/') > HTTPResponse().addCookie(astiCookie) > >... and now what? If I try HTTPResponse().deliver(astiCookie) it throws >an exception saying the cookie instance has no attribute '_session' or >HTTPResponse().deliver('astiuid') throws AttributeError on _session. > >I've tried just about everything I can think of, guided by the >documentation in the WebKit modules, to no avail. Can someone spell it >out for me like I'm an idiot--which I must be if I can't set a damn >cookie! ;) > >As always, thanks in advance for any/all help. >-Gary > >_______________________________________________ >Webware-discuss mailing list >Web...@li... >http://lists.sourceforge.net/lists/listinfo/webware-discuss > |