Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

session_start() Error

Tags:

php

session

i have some Problems with session_start();

I know that nothing should be outputted before the session_start(); statement

But i can't find the Problem in my Script

index.php:

<?php session_start();
include('functions.php');
if(!is_logged_in(session_id())){
    include('form.php');
}else{
?>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
<?php
}
?>

But i always geh following Error:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\fertige_scan\index.php:1) in C:\xampp\htdocs\fertige_scan\index.php on line 1

I hope you can help me :)

like image 994
Jings Avatar asked Dec 09 '22 10:12

Jings


2 Answers

Make sure you save your file without BOM if saving them in UTF8

like image 152
Capsule Avatar answered Dec 14 '22 22:12

Capsule


Make sure your file is saved as ANSI format not UTF-8 format.

like image 41
Spidy Avatar answered Dec 15 '22 00:12

Spidy