The manual is right, session_start should always return true. For example
using this code:

<?php
$sess = session_start();

if ($sess = 1){
echo "Session start returned TRUE";}

?>

PHP is set to save to C:\tmp which does not exist. But, because session data
is not saved at the beginning of the page where the session_start is called,
but at the end there the script is through executing, the session_start
still worked. The saving did not.

This script would put out the following:

-----------------------------------------


Warning: open(/tmp\sess_01ef33d269ce2ea08b2b8c8899375152, O_RDWR) failed: m
(2) in C:\apache\htdocs\blog\test.php on line 2
*** The above is PHP trying to obtain previous session data which it cannot
find.

Session start returned TRUE

Warning: open(/tmp\sess_01ef33d269ce2ea08b2b8c8899375152, O_RDWR) failed: m
(2) in Unknown on line 0


Warning: Failed to write session data (files). Please verify that the
current setting of session.save_path is correct (/tmp) in Unknown on line 0

-----------------------

Dennis Cole
DCW Productions.us

-----Original Message-----
From: Mr Percival [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 23, 2003 11:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] session_start


Hi,

According to the PHP manual session_start always returns true.

Ther are times (like when there is a disk full error on the server) that the
sesison_start will fail because its unable to write the session tmp file.

So shouldnt session_start be able to return false if the file write fails?

Or does it return false but the manual doesnt say so?
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to