<?php
	//echo "<font face='Verdana' style='font-size: 9pt' color=green> session.php is here... <br> </font> ";
	
	//ob_start();			// <-------- ob_start must be on top!!!
	//session_start();	// <-------- session_start must be on second top!!!
	
	error_reporting(E_ALL);
	ini_set("display_errors", 1);

	include("lock/login_config.php");

	$login_session="";

	//----- Check session with database -----//
		$user_check = $_SESSION['login_user'];		// <-------- session fr login.php
		//echo "user_check =" . $user_check. "<br>" ;
		$ses_sql = "select username FROM table03_engineer_password where username = '$user_check' ";
		$result_sql = mysqli_query($db,$ses_sql);
			
		$row = mysqli_fetch_array($result_sql,MYSQLI_ASSOC);
		$login_session = $row['username'];


	//----- If no session redirect to login.php  -----//

		if(!isset($_SESSION['login_user']))
		{
			header("location: login.php");
			die();
		}
		
		
?>