Apache-SessionManager
view release on metacpan or search on metacpan
SessionManager.pm view on Meta::CPAN
foreach my $header ( $r->dir_config->get('SessionManagerHeaderExclude') ) {
my ($key,$value) = split(/\s*=\s*>\s*/,$header,2);
# Header and its value must exists in order to check it
next unless ($r->headers_in->{$key} && $value);
if ( $r->headers_in->{$key} =~ /$value/i ) {
return (MP2 ? Apache::DECLINED : Apache::Constants::DECLINED)
}
}
# Set exclusion extension(s)
$session_config{'SessionManagerItemExclude'} = $r->dir_config('SessionManagerItemExclude') || '(\.gif|\.jpe?g|\.png|\.mpe?g|\.css|\.js|\.txt|\.mp3|\.wav|\.swf|\.avi|\.au|\.ra?m)$';
# declines requests if resource type is to exlcude
return (MP2 ? Apache::DECLINED : Apache::Constants::DECLINED) if ( $r->uri =~ /$session_config{'SessionManagerItemExclude'}/i );
$session_config{'SessionManagerStore'} = $r->dir_config('SessionManagerStore') || 'File';
$session_config{'SessionManagerLock'} = $r->dir_config('SessionManagerLock') || 'Null';
$session_config{'SessionManagerGenerate'} = $r->dir_config('SessionManagerGenerate') || 'MD5';
$session_config{'SessionManagerSerialize'} = $r->dir_config('SessionManagerSerialize') || 'Storable';
$session_config{'SessionManagerExpire'} =
$session_config{'SessionManagerExpire'} =~ /^(none|no|disabed)$/i ? 0
SessionManager.pm view on Meta::CPAN
All the HTTP requests containing the 'exclude_string' string in the URI will be
declined. Also is possible to use regex:
PerlSetVar SessionManagerItemExclude "\.m.*$"
and all the request (URI) ending by ".mpeg", ".mpg" or ".mp3" will be declined.
If C<SessionManagerItemExclude> isn't defined, the default value is:
C<(\.gif|\.jpe?g|\.png|\.mpe?g|\.css|\.js|\.txt|\.mp3|\.wav|\.swf|\.avi|\.au|\.ra?m)$>
B<Note> If you want process each request, you can set
C<SessionManagerItemExclude> with:
PerlSetVar SessionManagerItemExclude "^$"
=item C<SessionManagerHeaderExclude>
This directive allows to define HTTP headers contents in order to decline
requests that match them. For example:
( run in 1.312 second using v1.01-cache-2.11-cpan-df04353d9ac )