Bu şekilde deneyin hocam.
ob_start();
session_start();
if(!isset($_SESSION['login'])){
header("Location: login.php");
exit();
}else{
include('baglan.php');
}
Yine çalışmazsa bunu deneyin.
ob_start();
session_start();
if(!isset($_SESSION['login'])){
echo '<script>window.location = "index.php";</script>';
exit();
}else{
include('baglan.php');
}