raptor wrote:
> 
> hi,
> 
> Is there Session module that has capability more like ASP::Session
> rather than Apache::Session.(I mean hanlidng the cookies too, Joshua is
> it easy to extract Session functionality from ASP as a standalone module
> :")).
> OR
> what mostly the MASON people use to handle Sessions.
put this inside your handler.pl

        my %session;
        my $cookie_rec = $r->header_in('Cookie');
        my ($cookie) = $cookie_rec=~/SESSION_ID=(\w+)/;
        tie %session, 'Apache::Session::DBI', $cookie,
                {DataSource => 'dbi:mysql:sessions',
                UserName   => 'the username',
               Password   => 'the password'
        };
        $r->header_out("Set-Cookie" =>
"SESSION_ID=".$session{_session_id}.
                        ";
expires=".HTTP::Date::time2str(time+180*24*60*60) )
                if ( !$cookie or $cookie ne $session{_session_id});
        my $result=$ah->handle_request($r);
        untie %HTML::Mason::Commands::session if $SESSION;
        return $result;


Just cutted and pasted from mine, I removed some code not important
for the example. Take it easy.

-- 
 ^-^,-----.             mailto:[EMAIL PROTECTED]
 o o       )            http://www.etsetb.upc.es/~frankie
  Y (_ (__(OOOo

Reply via email to