I think it's a very bad idea to only allow one login from one browser. I often log in to facebook, twitter, google, demo.convos.by, ..., from multiple browsers at the same time.
I would probably do something like this: $c->session(uid => $user->username, sid => $session_row->id); That way you can allow multiple users being logged in at the same time from multiple devices. If something is shared across browsers, you can use the "uid" and if something is unique per browser, you can use the session row to store data. On Wednesday, August 20, 2014 8:01:09 PM UTC+2, Richard Sugg wrote: > > What's the best way to handle multiple authentication methods? I normally > have users login and create a session in the database. A user can only > login once at a time. If they open another browser and login, their first > session is invalidated. However, I also want to use some of the same urls > for automated processes which might run in parallel. If a two processes try > to authenticate and call a url, only the second process will have a valid > session. So for automation, it makes better sense to use Basic auth and > leave sessions to actual users. > > So what's the best way to handle this? Would I have to write a bridge that > checks one method and then the other? Or is there a better way? > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
