[dancer-users] Second cookie [ for 'remember me' username only ]

Nathan Bailey web at polynate.net
Mon Apr 24 01:25:35 BST 2017


Hi all,
 I'd like to have a 'remember me' cookie for users who want their username
to be remembered by the browser (but not the password).

Dancer2::Core::Role::SessionFactory's set_cookie_header seems quite
specific to sessions, so it appears that the right/best way to do it is to
use push_header (as set_cookie_header does), viz:
if (is_successful_login && defined params->{remember_me} &&
params->{remember_me}) {
    push_header(
        'Set-Cookie',
        (remember_me_user => session('user'))
   );
}

Is there a well-defined pattern for this?

cheers,
Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20170424/a6f92e60/attachment.html>


More information about the dancer-users mailing list