Welcome Guest, Not a member yet? Register   Sign In
Session Size Limit?
#1

(This post was last modified: 01-14-2016, 10:23 PM by donpwinston.)

I understand CodeIgniter implements sessions differently then the standard PHP session. Is there a limit on the amount of data I can put in it? A PHP session has no real limit (128MB?). If so then can I use the standard PHP session instead?
Reply
#2

If you use CI3, the limit is the same as PHP session. The default storage for session data is file system.
See http://www.codeigniter.com/user_guide/in...rary-usage

If you use CI2, the default is cookie session. All session data are stored in a cookie.
So the limit is the size of a cookie.
Reply
#3

(01-14-2016, 11:03 PM)kenjis Wrote: If you use CI3, the limit is the same as PHP session. The default storage for session data is file system.
See http://www.codeigniter.com/user_guide/in...rary-usage

If you use CI2, the default is cookie session. All session data are stored in a cookie.
So the limit is the size of a cookie.


Also, if using database sessions, you are also limited by the size of the data field. The documentation suggests a blob datatype, which has a size limit of 64K.

It's my opinion that if you are trying to store a huge amount of data in a session, you're doing it wrong. There are many different storage options for data, and I find that most of the time it fits nicely in a database record tied to the user. If you're attempting to use sessions to get around using an authentication system, then I suppose you would require more session storage, but that's not normally a great solution.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB