Made session creation a function; better experience on new user registration.