[cgiapp] Need help with Redirect

Stephen Carville stephen.carville at gmail.com
Fri Dec 26 16:33:01 EST 2008


I am writing a "make my life easier by letting users do some things
for themselves" program but I cannot get a redirect to work after
login.

Not all functions require a login so those that do issue a redirect to
bring up a login page.  For example if the user selects View Person
Information the URL looks like:

https://server/selfhelp/?rm=vpi

If there is no logged in session it redirects to:

https://server/selfhelp/&rm=auth&orm=vpi

So far, so good...

After entering a user name and password the form posts to:

https://server/selfhelp/

with parms:

user = username
pass = password
rm = authcheck
orm = vpi
button = (Cancel or Login)

If the user Cancels, the program sucessfully redirects back to beginning:

https://server/selfhelp/

Otherwise, after some sanity checks, authcheck authenticates against
the Kerberos KDC using Authen::Krb5::Simple.  It then sets

$self->session->param('logged-in',1);
$self->session->expire('logged-in',"+10m");

and attempts to redirct to the orginally requested page:

https://server/selfhelp/?rm=vpi

For some reason the redirect does not happen.

As near as I can tell from /server-status and the logs the process is
finishing correctly.  If I back up a couple of times within the time
out period and try the request again, it shows me the Personal
Information page.

If I look at the cgisess_ file before the second request:

$D = {'_SESSION_ID' => 'd6ee9a9550e40dbff06fca6e64639c16','logged-in'
=> 1,'_SESSION_ATIME' => 1230325867,'_SESSION_EXPIRE_LIST' =>
{'logged-in' => 600},'_SESSION_REMOTE_ADDR' =>
'10.212.202.63','username' => 'ttest','_SESSION_CTIME' =>
1230325823};;$D

So I think it safe to assume that $self->session-flush() in teardown()
is being called sucessfully.

Any idea what i am doing wrong?

I am using CGI::Application with perl, v5.8.8 built for
i386-linux-thread-multi and:

HTML::Template
CGI::Application::Plugin::Session
CGI::Application::Plugin::Redirect
Authen:;Krb5::Simple

-- 
Stephen Carville


More information about the cgiapp mailing list