SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Small Session Problem

    I'm trying to load the following php document on my personal computer:

    PHP Code:
    <?php
    session_start
    ();
    ?>
    But I get the following error:

    Cannot send session cookie - headers already sent by (output started at C:\...\session.php:1) in C:\...\session.php on line 2
    But that can't be right. This was a custom install of PHP and Apache on Windows XP, and I'm far from comfortable with that kind of thing, so I'm not sure what kind of information to provide here. Any ideas?

  2. #2
    SitePoint Evangelist AlienDev's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is that the only code in the file? And that file is session.php?

    That's a very strange problem.
    Me on StackOverflow | Blog & personal website.

    I mostly use: PHP, Java, JavaScript, Android.

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your text editor is putting an invisible Unicode byte order mark at the beginning of your file. Find out how to disable this in your editor.

  4. #4
    SitePoint Addict Latox's Avatar
    Join Date
    Dec 2008
    Location
    Australia
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    :-)

  5. #5
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to my knowledge, ob_start won't help with BOM

  6. #6
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I changed the encoding to "UTF-8 without BOM" and that did it. Thanks.


Bookmarks

Posting Permissions

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