Bug fix for setting session

Session was new being set after logging in.