Hi!
The following code hangs after reloading and the try to tie again the
previously created session! WHY?
package Loop;
use strict;
use Apache;
use Apache::Session::File;
use CGI qw(:cgi);
use Devel::Symdump;
use Data::Dumper;
use vars qw(
$id $sID
$lockDir
%session $sessionDir
);
sub handler{
if(defined ($id = param("sID")) && -f
"/usr/local/httpd/htdocs/action/sessions/$id"){
print STDERR "found $id :-}\n";
$sID =1;
eval{
tie %session, 'Apache::Session::File', $id,{
Directory => '/usr/local/httpd/htdocs/action/sessions',
LockDirectory => '/usr/local/httpd/htdocs/action/lock'
};
};
}
else{
eval{
tie %session, 'Apache::Session::File', undef,{
Directory => '/usr/local/httpd/htdocs/action/sessions',
LockDirectory => '/usr/local/httpd/htdocs/action/lock'
};
};
$id = $session{_session_id};
}
if($@){print STDERR "oops $@\n";}
untie %session;
print STDERR "$id redirecting2:
http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}?sID=$id\n";
print redirect "http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}?sID=$id";
}
1;
on STDERR I get:
c838622a5e5ec2b39a26c67b6731188f redirecting2:
http://localhost/action/leer.html?sID=c838622a5e5ec2b39a26c67b6731188f
found c838622a5e5ec2b39a26c67b6731188f :-}
my .htaccess :
<FilesMatch ".*\.html$">
SetHandler perl-script
PerlHandler Loop
</FilesMatch>
Thanks,
Axel
- Re: Apache::Session::File hangs Axel Huizinga
- Re: Apache::Session::File hangs Perrin Harkins