Mailing List Archive

session management -- %udat
Hi everybody,

We plan to develop a new site using Embperl.

Our current installed program :
Apache: 1.3.12 mysql: 3.22.32
Embperl: 1.3b2 Apache::Session: 1.03
etc.
----------------------------------------------------------------------------
----------------------------------------------------------------
in httpd.conf we set:

PerlSetEnv EMBPERL_SESSION_CLASSES "DBIStore SysVSemaphoreLocker"
PerlSetEnv EMBPERL_SESSION_ARGS "object_store=DBIStore
DataSource=DBI:mysql:session"

PerlModule HTML::Embperl
----------------------------------------------------------------------------
--------------------------------------------------------------------
We start using %udat to manage sessions, the test files are as followings:
# test1.epl
[-
$name = "hello";
$udat->{'username'} = $name;
-]
<html>
<body>
<a href="e2.epl">Press here to go somewhere else</a>
</body>
</html>

# test2.epl
<html>
<body>
[-
$username = $udat->{'username'};
-]
[+ "username=" +]
[+ $username +]
</body>
</html>

*when we jump to test2.epl from test1.epl, $username is not displayed at
all.

Please advise,

Regards,

Wei
RE: session management -- %udat [ In reply to ]
>
> PerlSetEnv EMBPERL_SESSION_CLASSES "DBIStore SysVSemaphoreLocker"
> PerlSetEnv EMBPERL_SESSION_ARGS "object_store=DBIStore
> DataSource=DBI:mysql:session"
>

You don't need the "object_store=DBIStore" in SESSION_ARGS, because it's
already in SESSION_CLASSES, but it doesn't hurt here.


> [-
> $name = "hello";
> $udat->{'username'} = $name;

%udat is a hash not a reference (or object), so you must write

$udat{'username'} = $name;

if you change this everywhere it should work.

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 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------