function sec_session_start() {
$session_name = 'exon_id_sessfval';
$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();
}
The following code above generates a headers already sent warning when in relation to session_start() even if I use ob_start() on the first line to try to ignore the problem.
its called on a page like follows:
<?php
include('./inc/sessions.php');
sec_session_start();
header("Location: index.php");
Any advice? Of course the header is included in a logical operator to check with a user is logged in, but its not outputting anything. The traceback comes to session_start() so I take it that it has something to do with cookie only sessions.
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /customers/b/2/5/edited.com/httpd.www/beta/login.php:1) in /customers/b/2/5/edited.com/httpd.www/beta/inc/sessions.inc.php on line 11
Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /customers/b/2/5/edited.com/httpd.www/beta/inc/sessions.inc.php on line 12
Warning: Cannot modify header information - headers already sent by (output started at /customers/b/2/5/edited.com/httpd.www/beta/login.php:1) in /customers/b/2/5/edited.com/httpd.www/beta/login.php on line 13