ESDEV-370 Fix random logouts from admin. Changed session starting back to session_start to fix possible loops. Added additional checks for available sid. Should fix some problems with Varnish (cherry picked from commit e2c52d3)