From: Tatsuhiko Miyagawa Date: Sun, 13 Dec 2009 03:08:32 +0000 (-0800) Subject: use TMPDIR env if it's defined in Store::File X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Session.git;a=commitdiff_plain;h=68fc9766bda1a5ff54271884a33cdbdea8a8e301 use TMPDIR env if it's defined in Store::File --- diff --git a/lib/Plack/Middleware/Session.pm b/lib/Plack/Middleware/Session.pm index 9bbe61c..a7433d1 100644 --- a/lib/Plack/Middleware/Session.pm +++ b/lib/Plack/Middleware/Session.pm @@ -54,7 +54,6 @@ Plack::Middleware::Session - Middleware for session management =head1 SYNOPSIS use Plack::Builder; - use Plack::Middleware::Session; my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ]; diff --git a/lib/Plack/Session/Store/File.pm b/lib/Plack/Session/Store/File.pm index 63b569e..8da664c 100644 --- a/lib/Plack/Session/Store/File.pm +++ b/lib/Plack/Session/Store/File.pm @@ -15,7 +15,7 @@ use Plack::Util::Accessor qw[ sub new { my ($class, %params) = @_; - $params{'dir'} ||= '/tmp'; + $params{'dir'} ||= $ENV{TMPDIR} || '/tmp'; die "Storage directory (" . $params{'dir'} . ") is not writeable" unless -w $params{'dir'};