move session functions to autoload