Session cookie still created with use_cookies=0
Posted: Tue May 20, 2008 4:32 pm
Hi. New to PHP ... just experimenting w/ sessions ...
Issue: Session cookies (with variables set inside) still created when session.use_cookies = 0 in php.ini (PHP5)
Php.ini:
session.use_cookies = 0
session.auto_start = 1
session.save_path = "C:\WINDOWS\Temp"
NOTE: Saved php.ini about 10 times and restarted apache each time …
simple code snippet:
<?php
echo "PHP Session ID is : ".session_id()."<br/>";
$_SESSION['user']='anyuser';
$_SESSION['password']='anypassword';
echo "User: ".$_SESSION['user']."<br/>";
echo "Password: ".$_SESSION['password']."<br/>";
echo session_save_path();
?>
What I don’t understand is that a session cookie is still created and the session variables are in it?
Output:
PHP Session ID is : 5dm124okj15r40cak5ej2qsm05
User: anyuser
Password: anypassword
C:\WINDOWS\Temp
Contents of new session file created in C:\WINDOWS\Temp (with name of above session)
user|s:7:"anyuser";password|s:11:"anypassword";
Am I confused?
Any help greatly appreciated 
Issue: Session cookies (with variables set inside) still created when session.use_cookies = 0 in php.ini (PHP5)
Php.ini:
session.use_cookies = 0
session.auto_start = 1
session.save_path = "C:\WINDOWS\Temp"
NOTE: Saved php.ini about 10 times and restarted apache each time …
simple code snippet:
<?php
echo "PHP Session ID is : ".session_id()."<br/>";
$_SESSION['user']='anyuser';
$_SESSION['password']='anypassword';
echo "User: ".$_SESSION['user']."<br/>";
echo "Password: ".$_SESSION['password']."<br/>";
echo session_save_path();
?>
What I don’t understand is that a session cookie is still created and the session variables are in it?
Output:
PHP Session ID is : 5dm124okj15r40cak5ej2qsm05
User: anyuser
Password: anypassword
C:\WINDOWS\Temp
Contents of new session file created in C:\WINDOWS\Temp (with name of above session)
user|s:7:"anyuser";password|s:11:"anypassword";
Am I confused?