fix registration and remove cookie on logout