Allow easy switching between user accounts


Hi there,

For the past several years, I’ve run a roleplaying forum using a PHP-based forum software. We’re currently looking at switching to Discourse because we like a lot of its built in features, especially for moderation.

One key feature that we currently have is the ability for our users to easily link together different accounts and switch between them. Users who play multiple characters will have multiple user accounts (1 per character), and being able to link those accounts allows for 1.) Easy listing of all characters of a player and 2.) Easy switching of user session without having to log out/log back in.

I’d like to know if either something like this already exists as a Discourse plugin or any advice on how to go about implementing it. It should be straight forward enough to use the custom user fields to hold a list of account names/IDs that are connected, but I’m less certain about how to go about switching the logged in user session.

Any help is greatly appreciated!

Note: This has nothing to do with the third party sign on services or trying to link accounts across different Discourse instances.

(Sam Saffron) #2

This is going to require some special plugin, also there are huge security implications to allowing account switching so you need to be ultra careful with the implementation. Also it gets super tricky if you want notifications to flow back up to the central account.

Probably talking a week of work to get something simple working nicely and a month or even 2 for something fancy.

We are planning on possibly building something similar for a gaming company some time in the next few years, but nothing I can think of that you can use today.


Thanks for the response! I figured I would need to develop a plugin to handle something like this. I’m not too concerned about having notifications bubbling up to a central account. It would be nice to have, but certainly not a dealbreaker.

I’m feeling good about being able to set up the process that would allow users to link their accounts together, but I’m less sure about how to implement the actual switching. Our current forum implements this by first checking permissions, and then deleting the existing user’s cookie, creates a new one, and then creates a new session.

Could you maybe provide some guidance as to where I would start/hook into creating a new user session?