Welcome Guest, Not a member yet? Register   Sign In
session problem
#1

[eluser]xaero[/eluser]
I have problem with sessions.

in autoload.php I set the following settings:

$autoload['libraries'] = array('database','session');

in routes.php I defined default controller:

$route['default_controller'] = "main";

And codeigniter displays the following error:

Code:
A PHP Error was encountered

Severity: Warning

Message: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:\home\vcms\www\system\application\controllers\main.php:1)

Filename: libraries/Session.php

Line Number: 141

I use the rewrited session library.
#2

[eluser]bitist[/eluser]
As you can see in the error message, header already sent by another file:
[quote author="xaero" date="1254996515"]
headers already sent (output started at Z:\home\vcms\www\system\application\controllers\main.php:1)
[/quote]

So probably you have an extra space in your controllers/main.php above <?php or after ?>.
#3

[eluser]xaero[/eluser]
here source of main.php:

Code:
<?php
class Main extends Controller {

    function Main()
    {
        parent::Controller();    
    }
    
    function index()
    {
        print "<h1>TEST</h1>";
    }
}
?&gt;
#4

[eluser]bitist[/eluser]
If you in this way
Code:
//print "<h1>TEST</h1>";
Whats is the result?
#5

[eluser]xaero[/eluser]
Still gives the same error:

Code:
A PHP Error was encountered

Severity: Warning

Message: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:\home\vcms\www\system\application\controllers\main.php:1)

Filename: libraries/Session.php

Line Number: 141
#6

[eluser]xaero[/eluser]
I found the error I changed the encoding file of main.php to cp1251 it works fine ... there is no any errors ?
#7

[eluser]Unknown[/eluser]
although it's too late but i want to share what the solution.
after had a discussion with my friend, the problem just there was a space before &lt;?php .
i tried to give some spaces after ?&gt; and then Codeigniter displaying that error like you showed.
so let there's no ?&gt; rather than error will be displayed because of a space after ?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB