session_start(); seems to give me this error on random.

PHP 5.0.1
Apache 2.0.51
Debian Build 2.6.8-1-686-smp
session.save_path = /tmp (permissions look fine)

Warning: session_start() [function.session-start]: Node no longer exists in (file path) on line (line with session_start()😉

This error does not happen predictably. Clearing out the sessions, cookies, etc. does not help. I have searched google for this error to no avail. It does not occur on specific pages (they all include the same header).

I don't think it's a problem with finding the file.

Any ideas? Any more information that you need?

    Hi Nathan,

    I think you might've answered your own question when you mentioned the header() function. I don't know for sure because I haven't used PHP 5 and I don't know if there are any differences in the implementation of sessions.

    I'm sure you know that you can't output anything (even whitespace) before a call to header(). That's not the actual problem in this case, but it shows that using header can have unexpected (at least, to me) consequences.

    Try commenting out the call to header(), or changing to one that you know works to see if it's this that's the cause.

    Paul 🙂

      Actually, what I meant by header is that it's a file included at the beginning of all the PHP pages. There is no whitespace output beforehand. When I google for the error, the only other place I see it is in SimpleXML, which is PHP5 only.

      In any case, I fixed it, though I'm not sure why this fixed it. I got rid of session_start();, and turned on the session.auto_start in the php.ini file. This really shouldn't have made a difference, as far as I can tell, but apparently it did. This appears to be a PHP5 bug of some sort, because there was no whitespace or header() call or anything simular before the session_start();.

      Any opinions on this?

        Oh right, yeah, I misunderstood what you meant by header.

        You say it doesn't occur site-wide ... is there any significant difference at all between the good and the bad pages?

          It can happen on any page. For instance, the index.php sometimes has the problem, but I might refresh on that same page and it'll go away. It can happen on any of the pages, but it's not consistant on any particular page... which why I think it's a PHP5 bug.

            Hi Nathan,

            Been racking my brains because I had something similar (but not the same) happen to me before. As I recall, it was to do with using cookies to facilitate sessions.

            I would be amazed if it was a bug, but, as I said before, I haven't used PHP5 so don't know.

            BTW, there is a category on the forum just for PHP5 ... you might get a better response posting a question there.

            Paul.

              Write a Reply...