Em Tue, 19 Nov 2002 15:38:12 +0000
Gerardo Schimpf <[EMAIL PROTECTED]> escreveu:
> Hello, I'm trying to use Sessions in embperl. I'm trying to see what
> is in the %session hash, more spesific i'm triying to print out the
> session_id ($session[_session_id]).
> My question is, how can I print out the session value?
>
> Thanks in advance....
>
> My structure in the Mysql database (sessions table) is the following:
>
>
> field type null
> ------------- -------- -------------------------
> id int(3) no auto_increment
> a_session varchar(255) yes
>
> and this is my code:
>
> [-
>
> use Apache::Session::MySQL;
>
> my $cookie=undef;
> my %session;
>
> tie %session, "Apache::Session::MySQL", $cookie, {
> DataSource => 'dbi:mysql:database;host=host', #these arguments
> are UserName => 'username', #required when using
> Password => 'password', #MySQL.pm
> LockDataSource => 'dbi:mysql:database;host=host',
> LockUserName => 'username',
> LockPassword => 'password'
> };
> -]
>
> [+ $session[_session_id] +]
>
Hi,
Setup session in the "Embperl way". Your setup should be in your
httpd.conf and in your html files just use the %udat hash provided
by Embperl.
Read the man pages:
perldoc HTML::Emperl
perldoc HTML::EmperlObject
perldoc Apache::Session::Store::MySQL
The 'session_id' is accessed with [+ $udat{_session_id} +]
Regards,
Luiz Fernando B. Ribeiro
Engenho Solu��es para a Internet
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]