I *just* tackled this problem myself! :-) I couldn't use the DBIStore
because of a bug some think is in PERL...it happens when the Session Manager
tries to connect to the database and throws a "die" because it can't for
whatever reason...the session never gets initialized...
Here's what I did: I switched to using file-based session storage in a tmp
directory under /cgi-bin, which does not allow a malicious user, even if
they knew a session id, to view any of the session information. Here's what
I put in my embpcgi.pl file (you can do the equivalent in your httpd.conf
file):
BEGIN {
# $ENV{EMBPERL_SESSION_CLASSES} = "DBIStore NullLocker";
# $ENV{EMBPERL_SESSION_ARGS} = "DataSource=DBI:mysql:dbname UserName=user
Password=pass";
$ENV{EMBPERL_SESSION_CLASSES} = "FileStore NullLocker";
$ENV{EMBPERL_SESSION_ARGS} =
"Directory=/usr/www/jbrisbin/httpd/cgi-bin/tmp";
};
I tried the DBIStore stuff with the NullLocker, because I was getting errors
when it was using SysV semaphore...so I switched it and this works
perfectly...all you'd have to do would be to put the equivalent PerSetEnv
(or SetEnv) on the SESSION_CLASSES and SESSION_ARGS to your liking...
You might want to try the DBIStore with the NullLocker and see if that helps
any...
Did you set up a table in your mysql db called "sessions" that has is like
"id char(32) not null primary key, a_session text"??
Jon Brisbin
www.jbrisbin.net
[EMAIL PROTECTED]
----- Original Message -----
From: Eric Knauel <[EMAIL PROTECTED]>
To: Embeded PERL ML <[EMAIL PROTECTED]>
Sent: Wednesday, August 02, 2000 8:24 AM
Subject: Problems with session management
>
> Hi,
>
> I have some trouble getting session management to work. I'm using
> Apache Session 1.03, Embperl 1.3b4 with mod_perl on Apache 1.3.12,
> here what I put in the httpd.conf:
>
> SetEnv EMBPERL_DEBUG 2375713
> SetEnv EMBPERL_VIRTLOG /embperl/log
> PerlSetEnv EMBPERL_COOKIE_DOMAIN "www.macnews.de"
> PerlSetEnv EMBPERL_COOKIE_NAME "SessionID"
> PerlSetEnv EMBPERL_COOKIE_PATH "/umfrage/dialog"
> PerlSetEnv EMBPERL_SESSION_CLASSES "DBIStore SysVSemaphoreLocker"
> PerlSetEnv EMBPERL_SESSION_ARGS "DataSource=dbi:mysql:session
UserName=apache Password=extremlysecret"
> PerlModule Apache::Session
> PerlModule HTML::Embperl
> <Location /dialog/umfrage>
> SetHandler perl-script
> PerlHandler HTML::Embperl
> Options ExecCGI
> </Location>
>
> However I never get a cookie from Embperl! I also tried with FileStore
> instead of DBIStore. Maybe I didn't understand the documentation
> right, but normally this small script should work:
>
> <html>
> <head>
> <title>Test</title>
> </head>
> <body>
> Hmm:<br>
> [$ if defined($udat{sometime}) $]
> <b>First started: [+ $udat{sometime} +]</b><br>
> [$ else $]
> [- $udat{sometime} = localtime; -]
> <b>Setting time to:</b> [+ $udat{sometime} +]
> [$ endif $]
> </body>
> </html>
>
> Everytime I reload this page it prints the server time... What am I
> doing wrong? ;-)
> Please let me know if you need more information!
>
> Ciao,
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]