<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I had this issue (more or less)<div class=""><br class=""></div><div class="">You can set the cookie name in the before hook</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">engine('session')->{cookie_name} = ‘my.dancer.cookie’;</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">— <br class="">Clive Eisen<br class="">GPG: 3818B5F1<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 27 May 2018, at 18:33, Erik Huelsmann <<a href="mailto:ehuels@gmail.com" class="">ehuels@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">Over at the LedgerSMB project (<a href="https://ledgersmb.org/" class="">https://ledgersmb.org/</a>), we moved a lot of our old CGI code to PSGI over the last year. Recently, I've factored out many "infrastructure" level items into Plack middleware.</div><div class=""><br class=""></div><div class="">We've wanted to move to Dancer as our web framework for years. And this weekend I made a first stab at such a move. As a result I have some questions (but more may come). Some questions were immediately answered by Stephan Hornburg in our chat channel (thanks Stephan!) but the most important one remains open.<br class=""></div><div class=""><br class=""></div><div class="">Question: Dancer2's documentation points out that we can use 2 applications hosted on 1 PSGI server. The relevant section is: <a href="http://search.cpan.org/~cromedome/Dancer2-0.205002/lib/Dancer2/Manual.pod#Running_multiple_apps_with_Plack::Builder" class="">http://search.cpan.org/~cromedome/Dancer2-0.205002/lib/Dancer2/Manual.pod#Running_multiple_apps_with_Plack::Builder</a></div><div class="">And while that works, both of these applications resolve their configuration to one and the same "config.yml". This is where my problem is: while I don't mind (would like to, even) share 99% of the configuration between two applications I want to mount, the two applications I want to mount, need separate authentication cookies. As far as I'm aware, I'd need to resolve to two different "config.yml" files (in my case I'd prefer "main_config.yml" and "setup_config.yml").</div><div class=""><br class=""></div><div class="">A bit of background to my question: LedgerSMB is an ERP application which consists of two logically separate applications: 'main' and 'setup'. "main" is the application for regular users while "setup" is for application/functional maintenance (application admin). Since many businesses have a "superuser" appointed as their admin, this user has 2 roles. He may want to log into both applications at the same time, each in a separate window on the same browser. In order to be able to do that, I need to be able to set the session cookie for both applications to be different from each other. It's my understanding that the "best" way to set cookie names through the configuration. Hence my question how to get two applications pointing to two different configuration files.</div><div class=""><br class=""></div><div class="">I've tried multiple approaches so far without success:</div><div class="">1. "use Dancer2 config_location => 'path/to/config';"<br class=""></div><div class="">2. read the sources of Dancer2 for a couple of hours<br class=""></div><div class="">3. Ask racke<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Could you please advise? Thanks in advance!<br class=""></div><div class=""><br class=""></div><div class=""><br class="">-- <br class=""><div class="gmail_signature"><div dir="ltr" class="">Bye,<div class=""><br class=""></div><div class="">Erik.</div><div class=""><br class=""></div><div class=""><a href="http://efficito.com/" target="_blank" class="">http://efficito.com</a> -- Hosted accounting and ERP.</div><div class="">Robust and Flexible. No vendor lock-in.</div></div></div>
</div></div>
_______________________________________________<br class="">dancer-users mailing list<br class=""><a href="mailto:dancer-users@dancer.pm" class="">dancer-users@dancer.pm</a><br class="">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br class=""></div></blockquote></div><br class=""></div></body></html>