Move session settings to ENV vars.
Clean up error block.