redirect to previous page after signing in and logging out