Results 1 to 2 of 2

Thread: user.php logout - headers already sent

  1. #1
    Pligg Donor keg01's Avatar
    Joined
    Oct 2007
    Posts
    74

    user.php logout - headers already sent

    Version: 1.0.0
    Template: wistie (though it seems to occur with any)

    I stumbled on a behavior I haven't been able to isolate to a root cause. When viewing the "Profile" page (user.php) and logging out, the user receives the following warning:

    "Warning: Cannot modify header information - headers already sent by (output started at /public_html/user.php:1) in user.php line 72"


    Logging from any other page does not cause an issue.

    This line is the header that redirect the user (see below, header('Location: ./') after logging out as below.
    PHP Code:
    // if not logged in, redirect to the index page
            
    $login = isset($_GET['login']) ? sanitize($_GET['login'], 3) : '';
            
    $truelogin = isset($_COOKIE['mnm_user'] ) ? sanitize($_COOKIE['mnm_user'] , 3) : '';
            if(
    $login === ''){
                    if (
    $current_user->user_id 0) {
                            
    $login $current_user->user_login;
                    } else {
                         
    header('Location: ./');
                            die;
                    }
            } 
    Not sure what headers are already being sent in this use case and I hope someone can isolate it.

    To recreate the issue:

    1. Log in
    2. Click on the link, "Profile"
    3. Click on the link, "Logout"

  2. #2
    Pligg Donor keg01's Avatar
    Joined
    Oct 2007
    Posts
    74
    File this one under, "Gave up to quickly." The root cause was core file customization in user.php. Case closed.

Similar Threads

  1. headers not appearing on story pages
    By Kabobbin in forum Questions & Comments
    Replies: 1
    Last Post: 04-24-2011, 07:45 PM
  2. Site Causes User Logout
    By exbionic in forum Questions & Comments
    Replies: 1
    Last Post: 04-10-2008, 07:31 AM
  3. Premature end of script headers
    By d4dirty in forum Questions & Comments
    Replies: 3
    Last Post: 01-03-2008, 08:22 AM
  4. The new banners in the headers - Gr8
    By dollars5 in forum Questions & Comments
    Replies: 1
    Last Post: 03-20-2007, 07:47 AM
  5. Edit rss2.php RSS Headers etc
    By kanedaguy in forum Questions & Comments
    Replies: 3
    Last Post: 02-16-2007, 08:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •