Perl, CGI::Session 4.35, "Don't know where to store the id" error
I am writing a web application that needs to use Session capability. I strictly only have access to module CGI::Session version 4.35 (backpan archive, closest version on CPAN).
When trying to use the module, specifically running this statement to create a new session (or retrieving the previous session):
use CGI::Session ('-ip_match');
…
$session = CGI::Session->new("id:incr", undef, {Directory => '/tmp'})
I'm having this error which I can't seem to find anywhere else:
Don't know where to store the id at (some_location)/x86-32.linux.2.6/5.8/lib/perl5/CGI/Session.pm line 79\n
I sense that this error i开发者_如何学Gos caused within the module itself, not from my code. Could you please confirm this?
You're trying to use CGI::Session::ID::incr and that module requires an IDFile argument so that it knows where to store the ID data.
use CGI::Session ( '-ip_match' );
...
$session = CGI::Session->new("id:incr",undef,
{Directory=>'/tmp',IDFile => '/tmp/id.file'});
精彩评论