Added session managemnt, introduced some bugs. TBF

Rendering/redirect bug. Waiting for StackOverflow
Fixed bug from previous commit