Hi,

I have a website where you need to login.
The login works fine, it saves the session variables as I need.
After browsing the site, maybe one minute, the session times out before it should.
I am not sure if this is related, but I moved my site a couple of days ago from one hosting to another. Ever since then, it seems this happens.

This is my part of my header:

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past 
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  // always modified 
header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1 
header("Cache-Control: post-check=0, pre-check=0", false); 
header("Pragma: no-cache");                          // HTTP/1.0  
date_default_timezone_set('Asia/Tel_Aviv');
session_set_cookie_params(18000);	//300 minutes (x * 60)
ob_start();
session_start();
//WEBSITE CODE GOES IN HEREh
ob_end_flush();

Any suggestions why and how i can prevent it from timing out?

i just tested the site on my old hosting and it does NOT time out.
I am guessing it has to do with php.ini or the hosting.
Any ideas what it can be?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.