(RADIATOR) Session-Timeout PostAuthHook

Herman verschooten H.verschooten at webvisie.net
Fri Dec 19 10:04:58 CST 2003


Hi,
 
I was looking for a way to dynamically set the session-timeout to the
end of the month.  Since this does not seem to be standard, I made an
attempt to write a PostAuthHook:
 
use Time::Local;
# If Session-Timeout=EM then set it to the number of seconds left in
this month.
sub
{
 my $p = ${$_[1]};
 
 my $SessionTimeout = $p->get_attr('Session-Timeout');
 if (defined $SessionTimeout)
 {
  if( $SessionTimeout eq 'EM')
  {
   my $sec;
   my $min;
   my $hour;
   my $mday;
   my $mon;
   my $year;
   my $wday;
   my $yday;
   my $isdst;
   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
 
   $mon++;
   $year+=1900;
 
   if($mon eq 12)
   {
    $mon = 0;
    $year++;
   }
 
   my $Timeout = timelocal(0,0,0,1,$mon,$year) -1 - time;
   $p->change_attr('Session-Timeout',$Timeout);
  }
 }
}

If anybody knows a better way to do this, please let me know.
 
Greetings,
 
Herman verschooten
 
 
WebVisie bvba
Een klare kijk op interne en externe communicatie
_______________________________________________
Oudaan 15 / 33        2000 Antwerpen       http://www.webvisie.net
<http://www.webvisie.net/> 
tel 03/206.72.70       fax 03/234.93.82      h.verschooten at webvisie.net
<mailto:h.verschooten at webvisie.net>    
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20031219/4ab6fe7e/attachment.html>


More information about the radiator mailing list