I'm walking through the tutorial on PHP freaks (http://www.phpfreaks.com/tutorials/41/1.php) regarding sessions and unfortunately didn't get very far.
I created a very basic page:
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix.
?>
<html>
<head>
<title>Start a Session</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
phpinfo();
?>
</body>
</html>
But get errors when I test that page:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at snipped:1) in snipped on line 2
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at snipped:1) in snipped on line 2
Warning: Cannot modify header information - headers already sent by (output started at snipped) in snipped on line 2
Now as you can see in my page I ran the phpinfo(); script so I can see if there are session settings in there and there sure are. Here are the settings that I have:
session
Session Support
enabled
Registered save handlers
files user
Directive
Local Value
Master Value
session.auto_start
Off
Off
session.bug_compat_42
On
On
session.bug_compat_warn
On
On
session.cache_expire
180
180
session.cache_limiter
nocache
nocache
session.cookie_domain
no value
no value
session.cookie_lifetime
session.cookie_path
/
/
session.cookie_secure
Off
Off
session.entropy_file
no value
no value
session.entropy_length
session.gc_divisor
100
100
session.gc_maxlifetime
1440
1440
session.gc_probability
1
1
session.name
PHPSESSID
PHPSESSID
session.referer_check
no value
no value
session.save_handler
files
files
session.save_path
/tmp
/tmp
session.serialize_handler
php
php
session.use_cookies
On
On
session.use_only_cookies
Off
Off
session.use_trans_sid
Off
Off
Can anybody figure out why I would be getting the error message?
Thanks in advance.