Welcome Guest, Not a member yet? Register   Sign In
Session and headers sent problems :(
#1

[eluser]chobo[/eluser]
I'm trying to get my new version of my site to work, but I'm running into problems with headers and session. This probably has something to do with me being on a shared host because I never have these problems on my test computer.

I made my own session wrapper library, it's very simple and when I run the init() function to start the session, it triggers the "headers already sen" error. I'm not sure how to get my session to run before the server sends it's headers. Any help is appreciated, thanks

Code:
/*
    *    Check if session has been started and if header have been sent
    */
    private function init()
    {
        if (! isset($_SESSION))
        {
            if (headers_sent())
            {
                trigger_error ('Session was not started before headers sent');
            }
            else
            {
                session_start();
            }
        }
    }


Messages In This Thread
Session and headers sent problems :( - by El Forum - 08-21-2007, 02:14 PM
Session and headers sent problems :( - by El Forum - 08-21-2007, 02:31 PM
Session and headers sent problems :( - by El Forum - 08-21-2007, 04:22 PM
Session and headers sent problems :( - by El Forum - 10-03-2007, 10:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB