<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">When the user comes to your site you would have some sort of login check that checks the session info (which is using cookies) - if the session is not valid you would normally marked them as not logged in and provide them with a login button of some sort. Rather than immediately marked them as not logged in based on their session, reach out to a new service or function that you will create that goes to central database of some sort to see if they already have a session on one of your other domains - if they do, grant them a new session.</div><div class=""><br class=""></div><div class="">It means you have to track sessions in a database to some degree. The cookie code is for the client side - you must have something server side to set up the session - I’m effectively saying make that part of the code shared in some way. A database would be easy in your instance, by abstracting it with a service would be more scalable.</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On 2 Jun 2020, at 4:54 pm, Gabor Szabo <<a href="mailto:gabor@szabgab.com" class="">gabor@szabgab.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">I am probably missing some basics here.</div><div class=""><br class=""></div><div class="">If I send out a cookie from one domain,e,g, .<a href="http://perlmaven.com/" class="">perlmaven.com</a> the browser will only send it to <a href="http://perlmaven.com/" class="">perlmaven.com</a> and its subdomains.<br class=""></div><div class="">Not to <a href="http://code-maven.com/" class="">code-maven.com</a> So when the user accesses <a href="http://code-maven.com/" class="">code-maven.com</a> how can I get the cookie?<br class=""></div><div class=""><br class=""></div><div class="">Gabor<br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 2, 2020 at 9:48 AM Matthew Mallard <<a href="mailto:matt@q-technologies.com.au" class="">matt@q-technologies.com.au</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Without knowing how you have currently set up auth, I would probably centralise the authentication to a separate service that each of the your apps (domains) reached out to check whether the user was already logged into your realm and whether they were allowed access to that particular domain. That way you can have exceptions down the track (if that becomes a requirement).<div class=""><br class=""></div><div class="">Does that help or were you looking for something lower level?<br class="">
<div class=""><br class=""><blockquote type="cite" class=""><div class="">On 2 Jun 2020, at 4:34 pm, Gabor Szabo <<a href="mailto:szabgab@gmail.com" target="_blank" class="">szabgab@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Hi,<div class="gmail_quote"><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I run both the Perl Maven site <a href="http://perlmaven.com/" target="_blank" class="">https://perlmaven.com/</a> and the Code Maven site <a href="http://code-maven.com/" target="_blank" class="">https://code-maven.com/</a> on the same Dancer2 application. They even share the database behind.</div><div class="">Both also have several language-specific hostnames. e.g. one in Telugu: <a href="https://te.perlmaven.com/" target="_blank" class="">https://te.perlmaven.com/</a></div><div class=""><br class=""></div><div class="">I would like to allow my users to log in any of the sites and then be already logged in all of the others. So they won't need to authenticate again.<br class=""></div><div class=""><br class=""></div><div class="">How could I achieve this?</div><div class=""><br class=""></div><div class="">Gabor<br class=""></div></div></div></div></div><a href="mailto:dancer-users@lists.preshweb.co.uk" target="_blank" class=""></a></div></div></blockquote></div></div></div></blockquote></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>
_______________________________________________<br class="">dancer-users mailing list<br class=""><a href="mailto:dancer-users@lists.preshweb.co.uk" class="">dancer-users@lists.preshweb.co.uk</a><br class="">https://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br class=""></div></blockquote></div><br class=""></body></html>