You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by tom joseph <t....@usa.net> on 2001/03/23 13:41:07 UTC

session management in perl

Hello there...

I have a doubt regarding the session management in perl.
The entries that I saw in the mailing list were speaking of mod_perl
which I did not understand.

I am not using mod_perl.  I use the Apache::Session module and tie a hash to
it and add session variables to the hash as soon as I start the session. I
just want to know whether it is possible to add more session variables while
accessing the session variables already added when the session was started.

I want to add more session variables after a session is started. Is it
possible.  I can't express the idea properly. 

I just start a session when the login.cgi is run. Then I add the login name as
a session variable in the next page called.  But this login name is not
retrieved when accessed from the third page.  But if I add a session variable
in the first page itself, it is possible to retrieve it in the third page. 
This is my problem.

Here is a portion of my code.

$dbh=DBI->connect('dbi:mysql:database=test;mysql_socket=/var/lib/mysql/mysql.sock','root');
use Apache::SEssion::MySQL;
tie %session,'Apache::Session::MySQL',$id,
{
Handle=>$dbh;
LockHandle=>$dbh
}
$session{login_name}="name";



Thanks in advance

Cheers
Dups

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: session management in perl

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

you could add more variables (or better to say hash keys). There maybe
another problem with your code.

If you are using Embperl, it's easier to use Embperl buildin session
management (which also uses Apache::Session), but provides the setup for
you. If you don't use Embperl, you are on the wrong mailing list. Then the
mod_perl list is the correct one to ask about Apache::Session (also you
don't use mod_perl). If you use Embperl and don't want to use its buildin
session management let me know why ?

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------

----- Original Message -----
From: "tom joseph" <t....@usa.net>
To: <em...@perl.apache.org>
Sent: Friday, March 23, 2001 2:41 PM
Subject: session management in perl


Hello there...

I have a doubt regarding the session management in perl.
The entries that I saw in the mailing list were speaking of mod_perl
which I did not understand.

I am not using mod_perl.  I use the Apache::Session module and tie a hash to
it and add session variables to the hash as soon as I start the session. I
just want to know whether it is possible to add more session variables while
accessing the session variables already added when the session was started.

I want to add more session variables after a session is started. Is it
possible.  I can't express the idea properly.

I just start a session when the login.cgi is run. Then I add the login name
as
a session variable in the next page called.  But this login name is not
retrieved when accessed from the third page.  But if I add a session
variable
in the first page itself, it is possible to retrieve it in the third page.
This is my problem.

Here is a portion of my code.

$dbh=DBI->connect('dbi:mysql:database=test;mysql_socket=/var/lib/mysql/mysql
.sock','root');
use Apache::SEssion::MySQL;
tie %session,'Apache::Session::MySQL',$id,
{
Handle=>$dbh;
LockHandle=>$dbh
}
$session{login_name}="name";



Thanks in advance

Cheers
Dups

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org