Xampp : Session Error

Below are the error in php due to session. This happens usually when server is unable to save the sessions data temporarily due to the improper path settings in session.save_path = “\xampp\tmp”.
Solution is to set the session.savepath correctly to point to directory where server can find it easily.

Warning: session_start() [function.session-start]: open(\xampp\tmp\sess_nsvvoh9f5l55g063d7qka1lq72, O_RDWR) failed: No such file or directory (2) in D:\htdocs\bull_ext\access_control\main.inc on line 39

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\htdocs\bull_ext\access_control\main.inc:39) in D:\htdocs\bull_ext\access_control\main.inc on line 39

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\htdocs\bull_ext\access_control\main.inc:39) in D:\htdocs\bull_ext\access_control\main.inc on line 39

Warning: Cannot modify header information - headers already sent by (output started at D:\htdocs\bull_ext\access_control\main.inc:39) in D:\htdocs\bull3\framework\application.inc on line 589

This settings is stored inside the php.ini file, which can be found under c:\xampp\php\ directory.

First stop the Xampp Server.

session.save_path = "\xampp\tmp"

and change it to look like this

session.save_path = "C:\xampp\tmp"

Restart the Xampp Server. That’s it now your session should work as expected.

Hope this was useful for someone.

Samundra Shrestha

Fullstack Developer, Senior Software Engineer

14 thoughts on “Xampp : Session Error

  • June 11, 2016 at 3:05 PM
    Permalink

    No it didnt worked…
    M using xampp version 7.0.1 over windows 8.1
    I have tried every method possible in php.ini….
    On the page i write the code to start session… the page shows error of “your connection was interupted”
    Means the xamp fails over that command… please help asap…

    Reply
    • June 13, 2016 at 3:08 PM
      Permalink

      Hey Ayush, sorry for late reply. Did you already solve the problem? If not can you try to post the error messages that you receive in the xampp log files.

      Reply
  • June 9, 2014 at 12:44 PM
    Permalink

    Thanks you very much, I had this problem because of moving www folder to another unit from C: to D: and changind this session path solved my problem.

    Reply
  • October 17, 2013 at 5:17 PM
    Permalink

    thank you, it helps perfect : “C:xampptmp”

    Reply
  • September 25, 2013 at 7:14 PM
    Permalink

    I had problems with XAMPP sessions and fixed it by setting this : session.auto_start = 1

    Reply
  • August 13, 2013 at 8:48 AM
    Permalink

    thanks…Its working…
    From long time i face problem related PHP session, but after getting this article i understand that “where session set”…
    again thank you very much….

    Reply
  • December 11, 2012 at 10:00 AM
    Permalink

    Thanks, helped a lot.

    Reply
  • November 8, 2012 at 7:35 PM
    Permalink

    But what about Mac? Any ideas there?

    Reply
    • November 8, 2012 at 7:52 PM
      Permalink

      The error happens when system cannot save session in the path setup in xampp. So my guess would be to verify if system can actually save the files in the supplied path or not. Sorry i cannot be of much help, I don’t have any experience with MAC.

      Reply
  • October 10, 2011 at 8:31 AM
    Permalink

    very useful! I was confronting the same issue and your advice solved it! Thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *