riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 21 forks source link

[FEATURE] Allow specifying domain for remember cookie #110

Closed dfalling closed 4 years ago

dfalling commented 4 years ago

Problem

My API is at api.mydomain.com, while my UI is at www.mydomain.com. I'm configuring Phoenix to use mydomain.com for the session cookie in my Session.Plug, but don't see a way to configure it for my remember cookie.

Solution

Add domain to the add_rem_cookie function. It's getting pretty long already, so maybe a keyword list for the args? Alternatively it could be added to the Remember plug.

riverrun commented 4 years ago

I will look into this in the new year - I am busy until then.

riverrun commented 4 years ago

I just uploaded a rem_cookie_options branch, and on that branch, I have added a domain option to add_rem_cookie. Could you try that and let me know if it solves this issue?

dfalling commented 4 years ago

Yes, that's exactly what I needed! Thanks!

riverrun commented 4 years ago

Version 2.3.1 has these changes.