# Copyright (c) 2012 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: Cookie3.bunit,v 1.3 2010/09/08 21:44:30 nagler Exp $ # Copyright (c) 2002-2010 bivio Software, Inc. All rights reserved. require './Cookie.PL'; [ [req(), req('r')] => [ { method => 'header_out', compute_params => sub { my($case, $params) = @_; # Bypass MODIFIED_FIELD, because we to test session code my($g) = $case->get('object')->internal_get; delete($g->{_modified}); $g->{d} = !defined($params->[0]) ? undef : DateTime()->add_seconds(now(), $params->[0]); config({ class() => { session_timeout_seconds => 10, session_update_seconds => $params->[1], }, }); return [req(), req('r')]; }, } => [ [-6, 5] => 1, [0, 5] => 0, [-20, 0] => 1, [0, 0] => 1, [undef, 5] => 1, ], ], ];