Notice: A session had already been started – ignoring session_start() in .. on line ..

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)
9 Comments 3,053 views

For an error like this

Notice: A session had already been started – ignoring session_start() in .. on line ..

This happens when you try to start session more than once.

The solution for above problem is

1) in php.ini file set session.autostart to 0

session.auto_start = 0

2) In your code use this line

if (!session_id()) session_start();

instead of

session_start();

Similar Posts

No similar recipes.

9 Responses to “Notice: A session had already been started – ignoring session_start() in .. on line ..”

  1. mocabilly 18. Dec, 2009 at 2:23 pm #

    I was told that, to get the session started, nothing, not
    even a blanc line was allowed “before” the session_start() function call..

    Will the session still be started properly?

    [Reply]

    Ajay Kumar Singh Reply:

    The solution provided above is for the “Notice: A session had already been started – ignoring session_start() in .. on line ..” problem.

    A blank line above session_start() would matter. After all it is a php code and in php blank lines are allowed.

    [Reply]

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  2. Sandeep 21. Feb, 2010 at 9:16 am #

    Thank you very much… yeah its working fine for me

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  3. Rey 11. Feb, 2011 at 10:44 pm #

    Thanks, i’ts solved my problem.
    Thank you very much

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  4. levi 18. Feb, 2011 at 12:23 pm #

    thanks, man.

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  5. olamide 02. Sep, 2011 at 9:33 am #

    thank you…it worked…

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  6. Pritam Soni 16. Nov, 2011 at 7:40 pm #

    Thanks for the help.. worked for me after searching a lot!

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  7. Hadrian Sabino 09. Feb, 2012 at 6:29 am #

    At last, I have been looking all over until this solution here. It works!

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
  8. raul 22. Feb, 2012 at 11:48 am #

    Put ob_start(); at the top of your index file or header file.

    [Reply]

    VA:F [1.9.17_1161]
    Rating: 0 (from 0 votes)

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.