neilwatson has asked for the wisdom of the Perl Monks concerning the following question:
<%args> $uname => 'x' $passwd => 'x' $url </%args> <%perl> use warnings; use strict; use lib "/var/www/itiv/modules"; use Mapps::Session; use Mapps::Auth; ########################## # try to authenticate ########################## my ($auth, $uid) = Mapps::Auth::auth($uname, $passwd); if ($auth == 1){ my $s = Mapps::Session->new(); my $sid = $s->new_session($uid); #my $sid = $s->sid(); # set cookie Apache::Cookie->new( $r, name => 'session', value => $sid, path => '/', expires => '30m', )->bake; $r->internal_redirect($url); $m->auto_send_headers(0); $m->clear_buffer; $m->abort; # else no auth }else{ $r->internal_redirect("/login.html?msg=Wrong%20username%20or%20pas +sword"); $m->auto_send_headers(0); $m->clear_buffer; $m->abort; } </%perl>
Neil Watson
watson-wilson.ca
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Mason's internal_redirect and setting cookies
by merlyn (Sage) on Aug 05, 2004 at 14:50 UTC | |
by neilwatson (Priest) on Aug 05, 2004 at 15:02 UTC | |
|
Re: Mason's internal_redirect and setting cookies
by Arunbear (Prior) on Aug 06, 2004 at 10:10 UTC |