Limit on the size of an array in $_SESSION?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sundial Services

    Limit on the size of an array in $_SESSION?


    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?

  • Chung Leong

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


    "Sundial Services" <info@sundialse rvices.com> wrote in message
    news:cogn7p$te3 $1@domitilla.ai oe.org...[color=blue]
    >
    > 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[/color]
    that[color=blue]
    > 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?
    >[/color]

    Not enough disk space in the partition where the session data get saved?
    I've tried this and it worked fine:

    session_start() ;
    $_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.


    Comment

    • R. Rajesh Jeba Anbiah

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

      Sundial Services <info@sundialse rvices.com> wrote in message news:<cogn7p$te 3$1@domitilla.a ioe.org>...[color=blue]
      > 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?[/color]

      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

      Comment

      Working...