You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Jonathan M. Hollin" <ne...@digital-word.com> on 2001/11/21 23:49:46 UTC
Apache::Session Problem
Fellow Perl Mongers,
Can anyone help with my latest programming riddle?
I am trying to take advantage of the session-handling features of
Apache::Session. My program includes the following code (line numbers added
for clarity):
20: # Session handler (I)...
21: use Apache::Session::DBI;
[cut]
40: # Session handler (II)...
41: my %session;
42: tie %session, 'Apache::Session::DBI',
43: {DataSource => "dbi:$db_driver:sessions:$db_address"};
44: my $session_cookie = "session_id=$session{_session_id};";
[cut]
The variables $db_driver and $db_address are imported from a small
configuration file that defines them as "mysql" and "192.168.0.201"
respectively.
My program dies when called (via CGI under mod_perl) with an "500 Internal
Server Error" with the following line appended to error.log:
[Wed Nov 21 22:25:12 2001] [error] PerlRun: `Can't locate object method
"TIEHASH" via package "Apache::Session::DBI" at
e:/apache/htdocs/shapeshifter/system/logon.cgi line 42.'
Platform: Win2K, Apache, mod_perl, MySQL...
Any suggestions (apart from quit programming and take up farming instead)?
Jonathan M. Hollin - WYPUG Co-ordinator
West Yorkshire Perl User Group
http://wypug.pm.org/
Re: Apache::Session Problem
Posted by Ilya Martynov <il...@martynov.org>.
>>>>> On Wed, 21 Nov 2001 22:49:46 -0000, "Jonathan M. Hollin" <ne...@digital-word.com> said:
Jonathan> Fellow Perl Mongers,
Jonathan> Can anyone help with my latest programming riddle?
Jonathan> I am trying to take advantage of the session-handling
Jonathan> features of Apache::Session. My program includes the
Jonathan> following code (line numbers added for clarity):
Jonathan> 20: # Session handler (I)...
Jonathan> 21: use Apache::Session::DBI;
Jonathan> [..skip..]
Jonathan> Platform: Win2K, Apache, mod_perl, MySQL...
Jonathan> Any suggestions (apart from quit programming and take up
Jonathan> farming instead)?
I'm not sure why your code doesn't work but why are you using such old
Apache::Session? Take new Apache::Session which provides MySQL support
via Apache::Session::MySQL.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-