The typical flow that's used with login forms (and any form that
ultimately changes client-side state via cookies) is this:

- User performs an http GET on the page with the form -- let's say /
login
- User enters data, and submits form via the http POST method
- webpy POST method checks user credentials:
  - If user login fails, it displays the web page with appropriate
error
  - Otherwise, it sets a cookie and redirects the user to some other
page. This is typically done by calling "raise web.seeother('/
postlogin')"

Since a successful call results in a redirect, the next page will send
back the session cookie correctly.

Hope this helps,
Justin


On Oct 26, 10:23 am, Tom <tom.thorog...@gmail.com> wrote:
> Greetings; awhile back I was having issues with web.py not retrieving
> cookies properly. That works now. However, if I try to set them and
> retrieve them within the same request, the retrieval fails, but
> reloading brings up the information just fine.
>
> For instance:
>
> Index, with POST submission -> Web.py verifies form and logs user in,
> setting a session cookie ->
> web.py renders index again, this time passing the cookie information
> (as the $def with parameter).
>
> Doing this will set the cookie, but raises an AttributeError when
> retreiving it to pass to the page. However, if I reload the page, it
> pulls it up just fine. Any workaround for this?
>
> Thanks,
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to