This depends how do you handle your sessions. I use mysql. but files work also.
What you describe is normal for Apache::Session::File.
1)
I use Mysql as session store. but files work also.
2) I configer Mason via handler.pl here is my:
------------------ handler.pl --------------------------------
package MasonXenon::Handler;
use HTML::Mason::ApacheHandler(args_method=>'CGI');
use strict;
use Apache2::Const qw(:common);
use Apache2::Request;
use Apache2::RequestRec ();
use HTML::FromText;
{ package HTML::Mason::Commands; # lots of funny Perl Modules ... thats why we use perl ;)
use Data::Dumper;
use vars qw(%session $dbh $dbs $dbb);
use CGI::Cookie;
use Apache::DBI;
use Apache2::Request;
use HTML::FromText;
use Net::SMTP;
use LWP::Simple;
use XML::Twig;
use Image::Magick;
}
#
# With session....
#
my %ah;
my %ah;
foreach my $site qw(xoanon) {
my $cRoot = "/home/$site/public_html/htdocs";
my $dRoot = "/home/$site/public_html/mason";
if ( $site eq "special_site_wich_is_special" ) {
$cRoot = "/somewehreelse/public_html/pjinfo";
$dRoot = "/somewehreelse/public_html/mason";
}
$ah{$site} = new HTML::Mason::ApacheHandler
( comp_root => $cRoot,
data_dir => $dRoot,
request_class => 'MasonX::Request::WithApacheSession',
session_class => 'Apache::Session::MySQL',
session_use_cookie => 1,
session_cookie_name => $site . "-cockie",
session_cookie_expires => "+4h",
session_data_source => 'dbi:mysql:general_session;',
session_user_name => 'xen_ses',
session_password => '5fG3!2',
session_lock_data_source => 'dbi:mysql:general_session;',
session_lock_user_name => 'secretmySQLuser,
session_lock_password => 'secretmySQLpass'
);
$ah{$site}->interp->set_escape( 'zv' => \&texthtml );
}
sub texthtml {
#my $r = $_;
#warn "esc seq: " .${$_[0]};
#my $r = $_;
${$_[0]} = text2html( ${$_[0]}, urls => 1, email => 1, lines=> 1, metachars => 1);
}
sub handler {
# Get the Apache request object
my ($r) = @_;
#print " blubb " . $r->dir_config('site');
my $site = $r->dir_config('site');
#return DECLINED if defined($r->content_type);
my $status = $ah{$site}->handle_request($r);
return $status;
}
1;
-----------------------------------------------------------
but .... if you use apache 2.2.0 and mod_perl2.0 with apreqlib you need to fix MasonX::Request::WithApacheSession:
e.g.: (quick & dirty ):
diff WithApacheSession.pm ./MasonX/Request/WithApacheSession.pmis the trick with my handler.pl - as long as it is ok that all site shares your "session db user"
19a20,2122a25,26
use Apache2::Request;87c91
< param_object => $self->apache_req,
---param_object => Apache2::Request->new( $self->apache_req ),
--------------------------------
a typical vhost entry:
<VirtualHost 162.198.1.1:80>
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /home/super/public_html/
ScriptAlias /cgi-bin /home/super/cgi-bin
ServerName www.localhost.de
ServerAlias www.localhost.de
<Directory /home/super/public_html/*>
Order allow,deny
allow from all
AllowOverride all
Options -FollowSymLinks -MultiViews
</Directory>
PerlSetVar site super
<FilesMatch "^.*?html">
SetHandler perl-script
PerlHandler MasonXenon::Handler
</FilesMatch>
<FilesMatch "^.*?comp">
SetHandler perl-script
PerlInitHandler Apache::Constants::NOT_FOUND
</FilesMatch>
PerlRequire /etc/httpd/handler.pl
ErrorLog /home/super/logs/super.de.error.log
CustomLog /home/super/public_html/logs/super.de.access.log common
</VirtualHost>
-----------------------------
PerlSetVar site super
.... this setup is usefull when you have many virtual hosts.
Hejdo
Timo
Am Mo 06.11.2006 05:51 schrieb sergio <[EMAIL PROTECTED]>:
> I have some questions about MasonX::Request::WithApacheSession..
>
> I can't understand some things
>
> 0) For each request in data and lock directories appear a pair of files..
> 1) How shall i create a session?
> 2) Where can i find some examples?
>
> this is part of /etc/apache2/sites-available/webmail.equator.ru.net file:
>
> PerlSetVar MasonRequestClass MasonX::Request::WithApacheSession
> PerlSetVar MasonSessionClass Apache::Session::File
> PerlSetVar MasonSessionCookieDomain .webmail.equator.ru.net
> PerlSetVar MasonSessionDirectory
> /var/lib/mason/webmail.equator.ru.net/sessions/data
>
> mason works throw mod_perl
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
[EMAIL PROTECTED]>
Powered by Open-Xchange.com------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users