MisterJames / CollidR

An open source project leveraging SignalR to make real time forms easy.
Apache License 2.0
22 stars 5 forks source link

If I login on two page in same brower, not detected by the program #9

Open gplesz opened 11 years ago

gplesz commented 11 years ago

Maybe could monitor the connection ID, then:

string connectionId = Context.ConnectionId; var username = string.Format("{0}|(connection:{1})", Context.User.Identity.Name, connectionId);

I do not know whether to be interesting, but you can watch here: https://github.com/gplesz/CollidR

(I also requested to send any pull.)

MisterJames commented 11 years ago

I actually hadn't considered solving that problem, i.e. "You are already editing this record in another browser", but that's a completely valid scenario. Thanks @gplesz :)

gplesz commented 11 years ago

I am happy if I can help, because I like to use the CollidR:)

But: if you leave the first page, the second page is gone from the userlist.

MisterJames commented 11 years ago

So, I like what you're doing here, but i want the user names to be kept in tact so that on the client they display in a human-friendly format. I'm going to extend the class that encapsulates the list of connections and add an ID to the user so that, server-side, I can track this type of connection...every browser tab has it's own connection ID so this should be easy enough.

gplesz commented 11 years ago

Exactly. (I've done it is neither beautiful nor practical, just an idea.)