no session_start()

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • caster001
    New Member
    • Nov 2006
    • 2

    #1

    no session_start()

    Hi everyone,

    This is my last hope, because no one seems to know the answer to my problem.

    The start of my page is this;

    <?php

    session_cache_l imiter('private ');
    $cache_limiter = session_cache_l imiter();

    session_cache_e xpire(30);
    $cache_expire = session_cache_e xpire();

    session_start() ;

    ?>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv="Content-Language" content="en-au">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Client Login</title>


    followed by the rest of the page, then on top of the page when it runs is;

    Warning: session_start() [function.sessio n-start]: Cannot send session cookie - headers already sent by (output started at /home/********/public_html/login.php:1) in /home/********/public_html/login.php on line 9

    Warning: session_start() [function.sessio n-start]: Cannot send session cache limiter - headers already sent (output started at /home/********/public_html/login.php:1) in /home/********/public_html/login.php on line 9


    Yet, I can still write session data and read it..etc. And I get a warning still if I even try to kill the session...so I don't know. I've also tried putting the code after the page's <head> and retyping the command to right under the <?php command.

    If ANYONE can help me, it would be a godsend.

    Thank you.
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Try to buffer the output:
    at the start of your program:[php]
    ob_start();
    .............
    ....... prog code php
    .........
    ob_end_flush;
    ?>[/php]

    Ronald :cool:

    Comment

    • jean123
      New Member
      • Nov 2006
      • 1

      #3
      I had a similar problem that I didn't ever solve involving writing headers so I'll be interested in the solution.

      In the remote chance that it helps, I had another problem involving the default session cookie that is supposed to expire when the browser closes. It did expire but when I moved my application from one directory to another, I could not access the page any longer and IE flagged it as a security violation.

      After much head scratching I simply deleted the supposedly expired PHP session cookie that had been created and that cleared up the problem.

      So if your application with these headers ever DID work and you have moved it perhaps my experience will help you track down the solution.

      cheers
      jean
      (a php novice)

      Comment

      • caster001
        New Member
        • Nov 2006
        • 2

        #4
        ok, I looked up the php.ini file...
        what happens if session_start isn't listed as a directive?

        Comment

        Working...