Haddar Macdasi
Haddar Macdasi

Reputation: 3555

signalr The connection id is in the incorrect format

I have a project build from mvc4 c# razor engine. I added latest signalr nuget package 1.0.1 My project uses form authentication. each time the client goes from login to logout and vise versa I get an error on the client :

> "NetworkError: 500 Internal Server Error -
> http://myhost:51090/signalr/abort?transport=serverSentEvents&connectionToken=uIJvYLP3T0GdHaowIlS4uPDA19ukUy7TaW8dcXoPfma4Mr52uoe7PLK9Hh3ip17X_3RbFXx92yEa7nxYVHaCiRAWVE5e05vvpLD0_blb94eUwdkXbmhkRPM2_Z590A64VBF2-eLB_8wCWq-dmkkkbe6EqP6c9YXN3WRF5IyNYkB6Wkom7O1ZoDavQQ0UWvok0"

and in the server side :

 The connection id is in the incorrect format.

do I need to consider working with signalr in different way (from https://github.com/SignalR/SignalR/wiki/QuickStart-Hubs) then with authentication ?

Upvotes: 1

Views: 5824

Answers (1)

N. Taylor Mullen
N. Taylor Mullen

Reputation: 18301

It seems that you are logging out (modifying your user) while you have an active SignalR connection.

The reason why this is happening is because on the abort request on the server we check to see if the connectionId is associated with the correct user. Therefore logging out while the connection is still active results in you losing your user association and causing an error.

To fix this, stop the SignalR connection before logging out.

Upvotes: 1

Related Questions