Get rid of deprecated API usage
Fix maybe possible DoS by infinite redirect loop:
- This applies what https://github.com/freenet/plugin-WoT-staging/commit/4f2c9a7839a236947ddfb01653ae541da898cd1a did for GET to POST as well
-  I am not certain about whether an infinite redirect loop would be possible with POST since the redirect will probably redirect to GET. But its a good idea to have such a check anyway.
Eliminate code duplication
Eliminiate code duplication
Terminate the session if the logged in identity is gone
Satisfy the compiler
Reduce line count