]> git.imager.perl.org - bse.git/commitdiff
the [basic].cookie_lifetime now works
authorTony Cook <tony@develop-help.com>
Thu, 5 Feb 2015 09:05:32 +0000 (20:05 +1100)
committerTony Cook <tony@develop-help.com>
Thu, 5 Feb 2015 09:05:32 +0000 (20:05 +1100)
by default this will make your sessions much shorter

site/cgi-bin/modules/BSE/Session.pm
site/docs/config.pod

index 1387bed16b2ee06891dbc32856a44e79c6bedc4f..6e8df8ad3cd51abc749bc471293663ec84bdbf62 100644 (file)
@@ -4,7 +4,7 @@ use CGI::Cookie;
 use BSE::DB;
 use BSE::CfgInfo qw/custom_class/;
 
-our $VERSION = "1.002";
+our $VERSION = "1.003";
 
 sub _session_require {
   my ($cfg) = @_;
@@ -112,7 +112,8 @@ sub make_cookie {
   my ($self, $cfg, $name, $value, $extras) = @_;
 
   $extras ||= {};
-  $extras->{lifetime} ||= $cfg->entry('basic', 'cookie_lifetime') || '+3h';
+  $extras->{expires} ||= $cfg->entry('basic', 'cookie_lifetime', '+3h');
+  $extras->{expires} =~ /\S/ or delete $extras->{expires};
   $name = $cfg->entry('cookie names', $name, $name);
   my %opts =
     (
index 6a4f1186db219df807176adab9e77e4c8389946e..e4131f8fb61bbf25d8066dda252ab59edd1c8d82 100644 (file)
@@ -333,7 +333,8 @@ example.com.
 The expiry time for cookies.  This should be in the form supported by
 CGI.pm for the -expires parameter.  Typically you want a plus ('+'), a
 number, and a time character (s - seconds, m - minutes, h - hours, d -
-days, M - months).  Default: +3h
+days, M - months).  Set to an empty string for session cookies.
+Default: +3h
 
 =item cookie_name