CodeIgniter Forums
php session_start(); - 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: php session_start(); (/showthread.php?tid=19793)



php session_start(); - El Forum - 06-18-2009

[eluser]new_igniter[/eluser]
Im dying from this stall caused by
Code:
sessions_start()
in php 5.


Can someone help me to know how I can get the 60+ second stalls to go away if I am calling
Code:
session_start()
on every page?

Thanks!!!


php session_start(); - El Forum - 06-18-2009

[eluser]Jondolar[/eluser]
Do sessions work even though it is slow? If not, then your host probably has something configured incorrectly.


php session_start(); - El Forum - 06-18-2009

[eluser]slowgary[/eluser]
I seem to remember reading that normal PHP sessions CodeIgniter do not get along very well. I could be wrong, but either way I'd recommend using the CodeIgniter session class instead. You really should never have to call session_start().

Code:
$this->load->library('session');

//to set some data
$this->session->set_userdata('your_field');

//to retrieve
$this->session->userdata('your_field');
Plus CI's session class makes storing sessions in the database very easy, so your apps can be more secure.