CodeIgniter Forums
session_start problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: session_start problem (/showthread.php?tid=12928)



session_start problem - El Forum - 11-05-2008

[eluser]dimis[/eluser]
I have 2 models that have controls at php session variables.
So I extend model class as
Code:
class My_Model extends Model {  
    function My_Model()
    {
        parent::Model();
        @session_start();


    }
}
and the 2 models extends this class .
At my log file I see that
Code:
ERROR - 2008-11-05 12:44:05 --> Severity: Notice  -->
A session had already been started -
ignoring session_start() C:\xampp\htdocs\dslook\system\application\libraries\My_Model.php 7
.
Is there any problem with that and how can I solve it?


session_start problem - El Forum - 11-05-2008

[eluser]Alexdamo[/eluser]
your decendant classes that extend My_Model class call its constructor (function My_Model), so the session_start() is called several times, that is the reason of the above log message.


session_start problem - El Forum - 11-05-2008

[eluser]dimis[/eluser]
Is there a way to call only once the session_start at a codeigniter application?
Dimis


session_start problem - El Forum - 11-05-2008

[eluser]new developer[/eluser]
Can you check your <?php line sometimes it happens when you give extra line before <?php tag..I may be talking useless but it happened to sometime before..


session_start problem - El Forum - 11-06-2008

[eluser]dimis[/eluser]
The reason is that i use wcart and I had problem using CI seesions.