added permanent relogin once user has logged in, as well as reauthenticating with credentials
fixed cookie encode uri component for allowed characters