CodeIgniter Forums
Non-database server-side session data storage - 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: Non-database server-side session data storage (/showthread.php?tid=9269)



Non-database server-side session data storage - El Forum - 06-19-2008

[eluser]Spockz[/eluser]
I'm looking for a standard way to store the user and session data of an session on the server, without using a database.

Currently I've a website running without a database because all the information is being supplied through xml. Is there any standard way to store the data on the server side?


Non-database server-side session data storage - El Forum - 06-19-2008

[eluser]gtech[/eluser]
do you want the data to be persitant?

a)you could just create a database specifically for storing session data.
b)or could just write the xml to a file. maybe have a file for each userid, have a hunt on google for 'flat files', you have to weigh up the pros and cons.

[url="http://www.designdetector.com/archives/04/10/FlatFileDatabaseDemo.php"]http://www.designdetector.com/archives/04/10/FlatFileDatabaseDemo.php[/url]
[url="http://www.joe2torials.com/view_tutorial.php?view=61"]http://www.joe2torials.com/view_tutorial.php?view=61[/url]


Non-database server-side session data storage - El Forum - 06-19-2008

[eluser]Spockz[/eluser]
Yes, the session data (IP etc.) should be persistant. Furthermore the user-data needs to be stored persistantly also.

The xml isn't part of the data that has to be stored in the session(s).


Non-database server-side session data storage - El Forum - 06-19-2008

[eluser]gtech[/eluser]
well you can store session data in a flat file in any format you like, I thought XML might be a good choice as a dataformat as you have certain php libraries to build and extract data.