Moved setting the sessions timeout to a single point in the code.