[Zope] Cookie Crumbler and querystrings

Ben Avery ben@thesite.org
Thu, 21 Nov 2002 14:47:40 +0000


Dieter Maurer wrote:
> Ben Avery writes:
>  > I am building a site where users must log in before being allowed 
>  > access. For this I use Cookie Crumbler, but I have a problem with it:
>  > 
>  > There are some URLs with querystring information, e.g.
>  > http://www.mysite.org/opportunity/cancel/?opp_id=29
>  > 
>  > The first time they try this link, the Cookie Crumbler redirects them 
>  > back to the login page for username and password. But after they have 
>  > logged in, they get taken back to
>  > http://www.mysite.org/opportunity/cancel/index_html
>  > without the querystring, which is necessary for the index_html method to 
>  > function.
>  > 
>  > Is there a way to avoid this problem, and to maintain querystring 
>  > through the CC login process?
> Yes.
> 
> Customize the "login_form".
> It remembers the original URL in a hidden form control.
> Add the "QUERY_STRING" to the value of this control.
> 
> 
> Dieter
> 

It remembers the original URL as 'came_from' but without the original 
querystring.
By the time you get to login_form, the original QUERY_STRING value has 
been lost, and it now contains the came_from.
e.g.
URL I'm trying to reach: http://www.mysite.org/opprtunity/cancel/?opp_id=29

cookie crumber redirects this to:
http://www.mysite.org/login_form?came_from=http%3A//www.mysite.org/opportunity/cancel/index_html&retry=

so if I access QUERY_STRING, it is now:
came_from=http%3A//www.mysite.org/opportunity/cancel/index_html&retry=
and my original:
opp_id=29
has been lost :(


Ben