Limit on the size of an array in $_SESSION?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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.

Any ideas?

Re: Limit on the size of an array in $_SESSION?

Quoted text here. Click to load it

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.

Re: Limit on the size of an array in $_SESSION?

Quoted text here. Click to load it

   Was it file based session (default) or custom session? Could you be
able to open the session file and manually analyze?

  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com

Site Timeline