Menu

Session Error

Help
2003-05-08
2003-05-10
  • Howard Picken

    Howard Picken - 2003-05-08

    Hi guys

    DLed SecureAdmin and MysqlConn etc installed and most seems to be OK, but I get the following error when accessing a secured page.

    Warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time. in /usr/local/www/pages/secure/include/_sessions.php on line 26.

    If I add user and password I get the following error

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/pages/secure/include/_sessions.php:26) in /usr/local/www/pages/secure/_restrict.php on line 16.

    Any ideas?

    Howard Picken
    Tasmania, Australia

     
    • Justin Koivisto

      Justin Koivisto - 2003-05-08

      Do you explicitly use session_start before calling _restrict.php?

      Do you have output (even a space before the first PHP tag) in your script before calling _restrict.php?

       
      • Howard Picken

        Howard Picken - 2003-05-08

        this is the top few lines of one of the pages.

        <?php require '/usr/local/www/pages/secure/_restrict.php';
        Include ('header.inc');
        include ('/usr/local/www/configfiles/registers.inc');
        if (!isset($id)) { // evaluates false
           $id = 0;
        }
        blah ....

        the header.inc file is just html stuff to add <head> <title> style sheet etc.
        the registers.inc file is to do with access to the mysql database (user password etc).

        Howard

         
        • Justin Koivisto

          Justin Koivisto - 2003-05-09

          I'd suggest trying a simple file like:

          <?php
              require dirname(__FILE__).'/pages/secure/_restrict.php';
              echo 'Logged in and ready for display';
          ?>

          See if you still get an error from that. Another thing to consider is that having 'auto_prepend_file' set to something that outputs will create problems. Possibly having 'session.auto_start' set may also cause problems.

          If you don't get problems from this, start adding your include files and code one piece at a time to see exactly where the error is coming from.

           
    • Howard Picken

      Howard Picken - 2003-05-10

      Fixed! I turned off session_autostart in php.ini.

      Thanks for all of your help.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.