Greetings all,In my C::A based web applications, I have traditionally created a parameter named "message" that I set when I want an informational message to display at the top of the output page. cgiapp_postrun() picks up on the existence of message and outputs that to my HTML template.
This has worked nicely, until now, mainly because it was all contained within the same script. Check out the code snipped below:
# Check the login credentials
my $username = untaint_string($self->query->param("username"));
my $password = untaint_string($self->query->param("password"));
if($username ne "" and $password ne "")
{
use KW::Users;
my $user = KW::Users->retrieve($username);
if($user and $user->login_password eq encrypt($password))
{
# Last check! User info matches, but are they active?
if($user->active_yn eq "Y")
{
# Log the user in
$self->session->param("username", $username);
$self->session->param("is_logged_in", 1);
}
}
}
$self->param("message", "Please enter a valid username and password
combination.")
unless $self->session->param("is_logged_in");
# Return the user to their chosen destination
return $self->redirect($redirect);
I realized that as my app grew more complex, I might want to redirect to
another script upon successful login (or whatever else I am doing). If
I need to pass a message when I redirect though, I'm screwed. The
redirection might take me to another script running in another Apache
process, and that wouldn't have access to the message parameter in the
originating process.
I need a way to pass parameters between the scripts. The logical choice is through the user's session, but that makes more than a few places that I would have to check to clear the message field if it is not needed.
Is there something simple I'm missing?
Thanks in advance!
Jason
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.