redirect to the last viewed page after sign in and sign out

[Delivers #53795491]