[Cgi-session-user] RE: Session not saving data files
Brought to you by:
sherzodr
From: Matt L. <mle...@cp...> - 2005-09-09 21:01:05
|
KG, Can you try the following one-liner and tell me if it succeeds? # following writes "hello" to a file in pwd called f.tmp perl -MFcntl=:DEFAULT,:flock,:mode -le'sysopen(FH,"f.tmp",O_WRONLY|O_CREAT) or die $!;flock(FH,LOCK_EX)or die $!;truncate(FH,0) or die $!;print FH "hello";close FH' && cat f.tmp && rm f.tmp And just for debugging information, please try the following script: #!/usr/bin/perl -w use File::Spec; use Test::More qw/no_plan/; use CGI::Session; if (CGI::Session->VERSION >= 4) { *CGI::Session::DESTROY = sub { my $s = shift; $s->flush() or die "Flush seems to have failed: ".$s->errstr; }; } my $dir = File::Spec->catdir('t', 'sessiondata'); my $id; my $ses = CGI::Session->new(undef,undef,{Directory=> $dir }); $id = $ses->id(); ok($id, "found session id"); END { ok(-r "$dir/cgisess_".$id, "found session data file"); } If you want to test it against 4.02 without reinstalling it, download CGI-Session 4.02 <http://search.cpan.org/CPAN/authors/id/S/SH/SHERZODR/CGI-Session-4.02.tar.gz>, unpack it in the pwd and run with: perl -ICGI-Session-4.02/lib script.pl Thanks, Matt LeBlanc |