What function or $user variable do I edit to manually increase a user's session timeout? I'm using the simpleSAMLphp module which redirects the user offsite to login and then hits them back to drupal in a logged in state, but for some reason the sessions aren't getting applied. When the user closes the browser it causes the user to be logged out. 

But when I login via the drupal login page, the user session persists even if the browser is closed. 


What function should I look for in the simpleSAMLphp module where it logs the user in?
What might I need to know or edit to make a assign a session time to a user?
Is the session information stored in the $user variable and can I manipulate it from there? or is it a database edit?
There are several modules that can do this for you.

https://www.drupal.org/project/session_cookie_lifetime
https://www.drupal.org/project/remember_me
https://www.drupal.org/project/persistent_login

I've had some problems with remember me and am still testing the others, but they give you more control over the session lenght.

By default drupals session expire after about 3 weeks, according to

ini_set('session.cookie_lifetime',  2000000);


You should be able to override this variable at database level as well, if you want to.