CodeIgniter Forums
problem in session -- big data save into session! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: problem in session -- big data save into session! (/thread-41690.html)



problem in session -- big data save into session! - El Forum - 05-14-2011

[eluser]hyddd[/eluser]
i want to save a big data into session. but it failed. And no message show where it failed~~~


the problem is:
1. why ci save session_data into cookie??
2. how to save big data to session when i dont want to modify the ci?Though i known a big data save in session is not suitable.


problem in session -- big data save into session! - El Forum - 05-14-2011

[eluser]hyddd[/eluser]
i come from china, so i hope u can understand my broken english~Smile


problem in session -- big data save into session! - El Forum - 05-14-2011

[eluser]pickupman[/eluser]
You want to make sure that you are using the database for sessions. It's a little safer and allows a lot more data to be saved than the 4kb cookie option.

See [url="http://ellislab.com/codeigniter/user-guide/libraries/sessions.html"]Saving Session Data to a Database[/url], then you may have to adjust the field size for the user_data column. Read the [url="http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html"]MySQL storage requirements[/url] and find out what data type will hold your information. May LONGTEXT or MEDIUMTEXT.

Keep in mind oversizing you columns will also slow down your database, as well fragment it with a lot of read / writes for session information.


problem in session -- big data save into session! - El Forum - 05-15-2011

[eluser]hyddd[/eluser]
o, thank u so much, i ignored the importance message before~