Session errors when uploaded to host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,


I've developed my site, and tested on a web host (Apache, PHP 4.3.9).
Now I've uploaded to a different host (IIS, PHP 4.3.1) where I want to keep it, and I get session error messages like:


Warning: session_start() [function.session-start <http://www.php.net/function.session-start>]: open(/tmp\sess_30f6794de4b0d80b91035c6c01aae52d, O_RDWR) failed: No such file or directory (2) in E:\W3Sites\ywamsa\www\timburgan\index.php on line 9

Warning: session_start() [function.session-start <http://www.php.net/function.session-start>]: Cannot send session cookie - headers already sent by (output started at E:\W3Sites\ywamsa\www\timburgan\index.php:9) in E:\W3Sites\ywamsa\www\timburgan\index.php on line 9


My code on line 9 is: This is the first line of my code session_start();

My code on line 12 is: This is the second line of my code
header("Cache-control: private");


Is there any solution to this? Tim



PS. I looked up session_start() in the PHP manual, and found this comment that may offer a solution that I've pasted below. Will this work? Are my problems a bug with PHP and IIS?

[START QUOTE]
*tech at insights dot net dot au*
17-Oct-2004 04:28

|I am sure anybody that is trying to use IIS and PHP is throughly annoyed with the session_start() bug that recreates a new session every time it is accessed.

The problem is the session_id isn't passed before the session_start() so it creates a new session. So a simple sollution is:

$id = 473483478383834;
session_id($id);
session_start();

Another way that is a bit more dynamic using a Cookie to hold the session_id:

if (isset($SessID)){ session_id($SessID); }
session_start();
header("Cache-control: private"); // IE 6 Fix.
setcookie("SessID", session_id(), time() + 3600);


There are probably much better ways of doing this but for use with my offline Win/IIS setup it seems to be fine.

[END QUOTE]
|

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux