function session-start error

Discussion in 'Troubleshooting' started by jechilt, Aug 7, 2007.

  1. jechilt

    jechilt New Member

    Joined:
    Jul 16, 2007
    Messages:
    22
    This does not happen everytime I go to my page and I notice it only with my IE browswer.

    I have an external page checking for aMember log in. When the homepage loads, i get the following error:

    Line 2 reads:
    PHP:
    session_start();
    Any thoughts?
  2. jechilt

    jechilt New Member

    Joined:
    Jul 16, 2007
    Messages:
    22
    I use a little function to check for the session. This has resolved all my problems
    Code:
    //Start session variable.  Check if user is logged in and set $user variable
    
    function session_started(){
        if(isset($_SESSION)){ return true; }else{ return false; }
    }
    
    //Start the output buffer so we dont create any errors with headers
    ob_start(); 
    
    //Check to see if it has been started
    if(!session_started()){
    	session_start();
    }
    
    //Flush the buffer to screen
    ob_end_flush();
    
    if ($au=$_SESSION['_amember_user']){ // user is logged-in 
    blah blah blah
    }
    
  3. shamend143

    shamend143 New Member

    Joined:
    Nov 25, 2007
    Messages:
    6
    where do i have to add that ?
    iam getting same error
  4. mattclarkson

    mattclarkson New Member

    Joined:
    Dec 19, 2007
    Messages:
    1
    This doesn't work for me --I still get the same session_start errors. Is there more to it?

Share This Page