页面刷新时会更改会话ID

I have problem about session_id() is beeing changing every page refresh.

Actually im using this function of session:

function sec_session_start()
{
   $session_name = 'sec_session_id'; 
   $secure = false; 
   $httponly = true; 
   ini_set('session.use_only_cookies', 1); 
   $cookieParams = session_get_cookie_params(); 
   session_set_cookie_params($cookieParams["lifetime"], $cookieParams["path"], $cookieParams["domain"],
    $secure, $httponly);
   session_name($session_name); 
   session_start(); 
   session_regenerate_id(false); 
}

On every page im using

    include "function.php";
    sec_session_start();

so im doubting on this function because if i just use session_start(); the session_id() doesnt change. it stays the same , how ever if i call the session from that function sec_session_start() the session_id() changes.

what is wrong with that function ? i couldnt find whats going wrong. all my website is using sec_session_start() so i cant change to session_start().

any help much apreciated. Thanks.

I found the answer:

in fact

 session_regenerate_id(false); 

was generating the new session id even thought it saids false.

so what i done is just comment that line of session_regenerate_id(false); and everything works.

hope this will help some people .

Thanks to smozguurs suggestion.