5 BEGIN { *CORE::GLOBAL::time = sub() { $time } }
6 use Plack::Session::State::Cookie;
8 my $st = Plack::Session::State::Cookie->new;
9 $st->domain('.example.com');
12 $st->path('/cgi-bin');
14 is_deeply +{ $st->merge_options(id => 123) },
15 { domain => '.example.com', secure => 1, expires => $time + 3600, path => '/cgi-bin' };
17 is_deeply +{ $st->merge_options(id => 123, path => '/', domain => '.perl.org') },
18 { domain => '.perl.org', secure => 1, expires => $time + 3600, path => '/' };
20 is_deeply +{ $st->merge_options(id => 123, expires => $time + 1, secure => 0) },
21 { domain => '.example.com', secure => 0, expires => $time + 1, path => '/cgi-bin' };