Added server side validation when registering new users
If user can't be deserialized, simply delete the session instead of throwing error. This is necessary because we lose all newly registered users when restarting the server, while these users could be associated with cookies still.