<div dir="ltr">Awesome! I have no idea how I missed that part of the manual.<div><br></div><div>I'm using:</div><div><div> cookie 'remember_me_user' => undef, http_only => 1, expires => -1;</div><div>if they turn it off, which seems to delete it immediately.<br></div></div><div><br></div><div>thanks,</div><div>Nathan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 April 2017 at 17:21, Andrew Beverley <span dir="ltr"><<a href="mailto:andy@andybev.com" target="_blank">andy@andybev.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 24 Apr 2017 10:25:35 +1000 Nathan Bailey wrote:<br>
> Hi all,<br>
> I'd like to have a 'remember me' cookie for users who want their<br>
> username to be remembered by the browser (but not the password).<br>
><br>
> Dancer2::Core::Role::<wbr>SessionFactory's set_cookie_header seems quite<br>
> specific to sessions, so it appears that the right/best way to do it<br>
> is to use push_header (as set_cookie_header does), viz:<br>
> if (is_successful_login && defined params->{remember_me} &&<br>
> params->{remember_me}) {<br>
> push_header(<br>
> 'Set-Cookie',<br>
> (remember_me_user => session('user'))<br>
> );<br>
> }<br>
<br>
</span>You can just use the Dancer keyword "cookie":<br>
<br>
cookie 'remember_me_user' => session('user'), http_only => 1;<br>
<br>
<br>
Regards,<br>
<br>
Andy<br>
</blockquote></div><br></div>