Add domain to Session :: Cookie

53 views
Skip to first unread message

Denis Kuzmenok

unread,
Nov 13, 2011, 1:38:56 PM11/13/11
to psgi-plack
Hi.
I'm wondering how to add domain to Plack::Session::State::Cookie to
set cross-subdomain cookie with Builder.
The problem is that there are many domains and i should set cookie to
current domain (test.example.com => .example.com, etc). How can that
be done?
Thanks, in advance.

builder {
enable "Plack::Middleware::AccessLog::Timed", format => "%h %l %u
%t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D", logger => sub
{ $log->debug(@_) };
enable 'Session',
store => 'File',
state => Plack::Session::State::Cookie->new(
session_key => 'sid',
domain => '.example.com'
);
};

Tatsuhiko Miyagawa

unread,
Nov 13, 2011, 4:32:27 PM11/13/11
to psgi-...@googlegroups.com
You can set the domain per request in $env->{'psgix.session.options'}.

--
Tatsuhiko Miyagawa

Reply all
Reply to author
Forward
0 new messages