Redirect after session expiry to the previous loaded page

* fixes #6945
fix redirect URL unit test
Merge pull request #9338 from owncloud/fix-redirect-for-appframework

Redirect after session expiry to the previous loaded page