Session_start () error

I have some problems with session_start ();

I know that nothing should be output before session_start (); Statement

But I can not 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 follow the error:

Warning: session_start () [function.session-start]: Unable to send session cookie - headers already sent (output started from C: \ XAMPP \ HTDOCS \ fertige_scan \ index.php: 1) to C: \ XAMPP \ HTDOCS \ fertige_scan \ index.php on line 1

Hope you can help me :)

+4
source share
3 answers

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

+4
source

Make sure you save the file without specification if you save them in UTF8

+6
source

Assuming you removed the extra characters after <? and to ?> and what session_start(); is the first statement, you can try changing the file encoding to ANSI or UTF-8 without specification, as suggested in the session_start PHP Documentation .

+2
source

Source: https://habr.com/ru/post/1341050/


All Articles