Thanks, Mark,
Actually, I figured it out veeery late last night. Turns out that I
was die'ing in setup() because I was trying to create a user object
there based on the $self->session('user') value as set in
CGI::Application::Login. This is a problem because the redirect only
happens *after* you return from your run mode.
The problem was that in my run mode -- in this case, my initial method
of 'menu' -- I needed an instance of my User object, which couldn't
happen since I didn't have a username.
Solution:
1) Don't die in setup()!
2) return unless $self->session('user'); in run mode
A thought that I haven't tried is to create a bailout run mode that
just returns. If the code in cgiapp_init fails, and I have to set up
the redirect stuff (the below does work, and does seem to be supported
by CGI, BTW) to set the run mode to 'bailout' and be done with it. At
that time, having set the header_type to 'redirect', I'll be sent off
nicely to the login script.
Thanks, everybody.
Steve, I'll bang on this code a bit and send you what comes of it.
-Eric.
Mark Stosberg: [Tuesday 4-December]:
> Eric Berg wrote:
> >
> > $self->header_props( -location => 'http://location/of/login.cgi' );
>
> Eric,
>
> try using "url" or "uri" instead of "location". I'm not sure "location"
> is supported in CGI.pm as you've used it.
>
> -mark
>
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Mark Stosberg Principal Developer
> [EMAIL PROTECTED] Summersault, LLC
> v: 765-939-9301 ext 223 website development
> . . . . . http://www.summersault.com/ . . . . . . .
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]