ramon.leon at allresnet.com
Tue Sep 22 16:57:30 UTC 2009
>>> Can't I add a cookie to a given response without asking the browser to
>>> make a new request?
>> In Seaside 2.8 that's not possible because we don't have access to the
>> response. In Seaside 3.0 this is possible. If you want/need it in
>> Seaside 2.8 you'll probably want to add them to your session, add them
>> to the response in #returnResponse: and then nil them out.
> Thank for the answer. I think I will do a redirect until I have no other
It's fairly trivial to do what you want in 2.8 just by adding a couple
things to your session class. Something like...
responseBlocks := OrderedCollection new.
responseBlocks add: aBlock
responseBlocks do: [:e | e value: aResponse ].
^ super returnResponse: aResponse
Then from your component whenever you want to add something to or do
something with the response, you just do...
self session onResponse: [ :r |
r addCookie: (WACookie key: #visited value: 'true') ].
self session onResponse: [ :r | r forbidden ]
More information about the seaside