Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Limit on the size of an array in $_SESSION?
- Sundial Services
November 30, 2004, 3:51 am
rate this thread
I have an object in the session-data which contains a search-result list.
It might, at various times, contain 16,000 entries or more.
I seem to be noticing, however, that when the size of the result-list is
more than around 1,000 records ... the object simply does not get saved
into the $_SESSION data at all.
The PHP memory-limit is 30 megs. I never see any curious output in the
Apache logs, and the application does not fail. The trouble is simply that
when the search result is large, and the search-results page enters, it
finds that there is no search-result object in the session data. For a
smaller result set, and /identical/ code, the object is there.
Re: Limit on the size of an array in $_SESSION?
Not enough disk space in the partition where the session data get saved?
I've tried this and it worked fine:
$_SESSION['test'] = array_fill(0, 32000, "banana");
Do remember that session data is not stored in memory. It's stored in a
file, which is read in its entirety for every page hit. Storing that much in
a session is thus not a very good idea.
- R. Rajesh Jeba Anbiah
November 30, 2004, 7:00 am