OK after days of frustration I have stumbled across and issue with sessions, unfortunately I am not sure if my the solution I found will become a security issue or Risk.
I was working on a php project on my localhost logged in the app and I could walk away for 5,10 even 15 minutes and come back and i could still proceed through my application logged in. When I uploaded my project to test online. if i logged in I could refresh in 2 - 3 minutes and would have to log back in.
I tried everything from about 50 posts on here and got no result. so I decided to read every line of phpinfo on my localhost and my host to compare. came up with nothing.. well I in fact over looked a detail..
So this morning with coffee a very little hair left.. I found the problem.
session.cache_expire 180
now this closes at 3 minutes regardless of the session lifetime. also on localhost,
session.gc_divisor 1000
the session.gc_divisor is 1000 on localhost but on my web host its 100,
Now I have a file called sessions.php and in it is my session_start. the solution i found was here. http://php.net/manual/en/function.session-cache-expire.php
so i have changed my session file to the following.
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
session_cache_expire(30);
$cache_expire = session_cache_expire();
session_start();
ob_start();
the result is when i leave my browser open for longer than 3 minutes it no longer requires me to log back in.. But is this a proper solution?