signalr - OnDisconnect and Logged on Users after recycle? -
i've read ondisconnect
( server side) , can bypassed ( application recycle etc).
the ondisconnected method doesn't called in scenarios, such when server goes down or app domain gets recycled.
and ask :
when user connects , generate him token
, keep in user cookie
, , when onconnect
called , attach connectionid
token.
(the same way ondiconnect
called , set value in datedisconnected
)
this supports 2 connected users ( same browser)
example :
example :
id tokenid connectionid datecreated datedisconnected ---------------------------------------------------------------------------------------------- 1 500 {1234-1234} 06-07-2013 null 2 500 {5432-5432} 06-07-2013 null
and here problem :
what happen if user has logged in (so write user in db logged in) , chat , , server restarted ?
the client try reconnect , after 30 seconds stop.
but then , when server (after hour ) - still have logged on user in db. , not. ( , not connection id anyway...)
how can solve kind of problem ?
the best way solve problem log out on application start, aka in case invalidate/delete logged in token rows. therefore whenever server comes application in fresh state no 1 logged in.
Comments
Post a Comment