But wait! That's not all!
But there is no reason to create the response. WebKit is an app server and
also an "object-oriented framework". Part of being a framework is "taking
care of you" which often includes creating objects when they need to be
created. In the case of WebKit, the request, response, session and
application are ready to be used:
Now you will be affecting the response that WebKit created for the
transaction and hence the cookie should find its way back to the client.
Likewise, you should use self.request(), self.session(),
self.application(), etc. when subclassing Page.
At 07:36 PM 8/8/2001 -0400, Jay Love wrote:
>Once you call response.addCookie(), you're done.
>Gary Perez wrote:
>>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
>> def setACookie(self):
>> astiCookie = Cookie('astiuid', 12345)
>> astiCookie.setComment('Your unique ASTi ID')
>>... 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
>>As always, thanks in advance for any/all help.
>>Webware-discuss mailing list
>Webware-discuss mailing list