[Seaside] Issue with #checkForCookies

Julian Fitzell julian at beta4.com
Thu Jul 21 20:25:09 CEST 2005

Hi German,

Well, to be honest I think the cookie stuff was added after I left for 
Australia so I'm not really familiar with it.  But, what I immediately 
notice from your code snippet is that you are answering directly from 
inside a render method, which is a bit unusual.  Since your render 
method doesn't actually do any rendering, the example you provide below 
would be much better encapsulated in a subclass of WATask (just put all 
that code inside the #go method).

A task allows you to run through a multistep process, asking questions 
and defining program flow, whereas a component is really designed to be 
shown to the user.  It's perfectly acceptable to call #inform: or 
#answer: inside a callback block that will be triggered by the user and 
executed during the execution phase.  But once the execution phase has 
been run and it has been determined that your component should be 
rendered, you don't want to be calling out to another component.

Does that make sense?


German Viscuso wrote:
> Hello list.
> When I try to use #checkForCookies in a seaside component I obtain the
> following
> message in the Transcript:
> "Warning: You have tried to set a cookie and a redirect in the same page,
> responding
> to the request /seaside/go/myapp. Some browsers will not handle this
> correctly."
> Has this issue been already reported or solved? (I'm using VW 7.3 nc and the
> web toolkit)
> My test code is:
> ---------------------------------------------------------------------------
> renderContentOn: html
> self session checkForCookies
>  ifTrue: [
>   self inform: 'Cookies enabled!'.
>   self answer: 'ok']
>  ifFalse: [
>   self inform: 'You must have cookies enabled to proceed.'.
>   self answer: nil ]
> ---------------------------------------------------------------------------
> Regards and thanks in advance,
> GV
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside

   Julian Fitzell  --  Beta4 Productions
julian at beta4.com  --  http://www.beta4.com
Seaside: http://seaside.st/

More information about the Seaside mailing list