CodeIgniter Forums
Codeigniter sessions - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: Codeigniter sessions (/thread-63296.html)

Codeigniter sessions - WaelBY - 10-16-2015

Hello my friends,
I am now working on my first project in Codeigniter and i need help. I want to use the "Session" library but i didn't find how to start!! Can anybody help me and send me links to some exemples or tutorials??
Thank you all. Big Grin Big Grin Big Grin Big Grin

RE: Codeigniter sessions - sampoyigi - 10-19-2015

That will definitely show you how to use the Session Library

Add session data with $this->session->set_userdata('some_name', 'some_value'); and retrieve it with $this->session->userdata('item');

RE: Codeigniter sessions - WaelBY - 10-19-2015

Thank you sampoyigi Smile

RE: Codeigniter sessions - WaelBY - 10-20-2015

Well i successfully use session in my project but the session data disappears in the first refresh!!! I searched all the net and i found that it's a common problem but i didn't find a good solution!!
Can anybody help me please!! :'(

RE: Codeigniter sessions - sampoyigi - 10-23-2015

I can only think of two reasons why the sesssion data will disappear after first refresh, either you are using the tempdata/flashdata or your session preferences is not correctly set in your configuration file.