[Seaside] 3.0 session/request redirect
radoslav hodnicak
rh at 4096.sk
Mon Feb 22 19:23:20 UTC 2010
On Mon, 22 Feb 2010, Philippe Marschall wrote:
> 2010/2/22 radoslav hodnicak <rh at 4096.sk>:
>>
>> I have an outside form submitting login information to enter my seaside app,
>> so as a first thing I want to do a redirect if the login info is correct, to
>> keep browser from resubmitting the info. In my session #start I do
>>
>> ... process login info, save user
>> self requestContext redirect.
>>
>> but when this code runs it gives me a 'You can only #call: and #answer: from
>> within a callback or a Task.' error. Why?
>
> Because control flow is only supported in the callback phase.
>
> Moving your login code to #initialRequest: of you root component (you
> don't need the redirect) should fix your problem.
I think this is something that changed between 2.8 and 3.0 - 'cause 2.8 is
doing the first redirect by itself.
2.8
plain html page with form
-> post to /seaside/seasideApp
-> seaside page, urlbar show address like
server.com/seaside/seasideApp?_s=...&_k=...
3.0
plain html page with form
-> post to /seasideApp
-> seaside page, urlbar show address like
server.com/seasideApp
there's no session or key parameter which means there was no initial
redirect. This is a problem
rado
More information about the seaside
mailing list