perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luiz Fernando B. Ribeiro" <l...@engenhosolucoes.com.br>
Subject Re: Sessions...
Date Wed, 20 Nov 2002 12:04:26 GMT
Em Tue, 19 Nov 2002 15:38:12 +0000
Gerardo Schimpf <schige@bibleinfo.com> 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: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message