<div dir="ltr"><div dir="ltr"><div>I don't think I understand the flow.</div><div><br></div><div>1) Registered user arrives to <a href="http://perlmaven.com">perlmaven.com</a> with a brand new browser (no session yet, no cookes).</div><div>2) Logs in, gets a cookie, login information is written to disk.</div><div>3) User arrives to <a href="http://code-maven.com">code-maven.com</a>   (no session yet, no cookies) How can I know this the same user as in 1) or someone else?</div><div><br></div><div>Gabor</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 2, 2020 at 10:03 AM Matthew Mallard <<a href="mailto:matt@q-technologies.com.au">matt@q-technologies.com.au</a>> wrote:<br></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;"><div>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><br></div><div>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><br></div><div><blockquote type="cite"><div>On 2 Jun 2020, at 4:54 pm, Gabor Szabo <<a href="mailto:gabor@szabgab.com" target="_blank">gabor@szabgab.com</a>> wrote:</div><br><div><div dir="ltr"><div>I am probably missing some basics here.</div><div><br></div><div>If I send out a cookie from one domain,e,g, .<a href="http://perlmaven.com/" target="_blank">perlmaven.com</a> the browser will only send it to <a href="http://perlmaven.com/" target="_blank">perlmaven.com</a> and its subdomains.<br></div><div>Not to <a href="http://code-maven.com/" target="_blank">code-maven.com</a> So when the user accesses <a href="http://code-maven.com/" target="_blank">code-maven.com</a> how can I get the cookie?<br></div><div><br></div><div>Gabor<br></div><br><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" target="_blank">matt@q-technologies.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>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><br></div><div>Does that help or were you looking for something lower level?<br>
<div><br><blockquote type="cite"><div>On 2 Jun 2020, at 4:34 pm, Gabor Szabo <<a href="mailto:szabgab@gmail.com" target="_blank">szabgab@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hi,<div class="gmail_quote"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><br></div><div>I run both the Perl Maven site <a href="http://perlmaven.com/" target="_blank">https://perlmaven.com/</a> and the Code Maven site <a href="http://code-maven.com/" target="_blank">https://code-maven.com/</a> on the same Dancer2 application. They even share the database behind.</div><div>Both also have several language-specific hostnames. e.g. one in Telugu: <a href="https://te.perlmaven.com/" target="_blank">https://te.perlmaven.com/</a></div><div><br></div><div>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></div><div><br></div><div>How could I achieve this?</div><div><br></div><div>Gabor<br></div></div></div></div></div><a href="mailto:dancer-users@lists.preshweb.co.uk" target="_blank"></a></div></div></blockquote></div></div></div></blockquote></div><div><br></div><div><br></div></div></div></blockquote></div></div></blockquote></div><br></div>