[Seaside] Cookies (again?)
David Röthlisberger
davidroe at bluewin.ch
Sun May 16 15:50:56 CEST 2004
> - add a "cookies" ivar to WAHtmlStreamResponse
> - override #cookies to return it:
> cookies
> ^ cookies ifNil: [#()]
> - implement #cookieAt:put: to use it:
> cookieAt: key put: value
> cookies ifNil: [cookies := Dictionary new].
> ^ cookies at: key put: value
> In Squeak, that should work. In VW, I don't know if the underlying
> support code that integrates with WebToolKit supports cookies yet.
yes, that works also in VW, thanks a lot.
For my purpose it is a little bit cumbersome to use HtmlStreamResponse to
set a cookie, because I have a login form, then a user clicks on the
'login'-button, so the corresponding method #login is called, where I check
user's nick and password and set a cookie. Afterwards I would like to call
WAComponent>>answer, so there won't be any html response from the
Login-Component. Now I had to render again the login-component, so I was
able to set the cookie using HtmlStreamResponse. But it would be more
convenient if it would be also possible to set a cookie before calling
WAComponent>>answer or WAComponent>>call, then this cookie could be appended
to the RedirectResponse (or something else).
And for the moment you can only set name and value of a cookie form Seaside,
but not things like expires time or domain of a cookie, or do I miss
something?
David
More information about the Seaside
mailing list