How can I do this in Python?

David Wahler dwahler at gmail.com
Fri Nov 4 11:34:11 EST 2005


Lad wrote:
> Hi,
> I have a web program and a user can have access to a page only after he
> logged in.
> So, the program comes with  a Login form and the user logins.But I do
> not know how to return the user back to where he came from, after a
> successful login.
>
> Something like this:
>
> PageWhereUserMustBeLogin -------->UserSigned----->-
>
> ^------<---------------------------------------------------<----|
>
>
> Thank you for help
>
> L.

You'll need to either use a hidden form field or check the HTTP
"Referer" header to determine the page the user was on. Then, just use
an HTTP redirect to send them back to that page.

Are you using a particular web application framework, or separate CGI
scripts?

-- David




More information about the Python-list mailing list