<?php
function verif_session(){
	if( isset($_SESSION['ip_utilisateur'])&&$_SESSION['ip_utilisateur'] == $_SERVER['REMOTE_ADDR']&&isset($_SESSION['hash_acces_utilisateur'])&&isset($_SESSION['user_agent'])&&	$_SESSION['user_agent'] == $_SERVER['HTTP_USER_AGENT']) return true;
	else {
		if(!isset($_COOKIE['PHPSESSID']))session_id($_COOKIE['PHPSESSID']);
		if(!header("Location:login.php")) print "<meta HTTP-EQUIV=\"refresh\" content=\"0; URL=login.php\"> ";
		return false;
	}
}
?>