473,597 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?

Jul 17 '05 #1
2 5547

"Sundial Services" <in**@sundialse rvices.com> wrote in message
news:co******** **@domitilla.ai oe.org...

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?


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.
Jul 17 '05 #2
Sundial Services <in**@sundialse rvices.com> wrote in message news:<co******* ***@domitilla.a ioe.org>...
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?


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
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13831
by: Robert | last post by:
Im a beginner in PHP and Im having a problem with this code. Im trying to remove duplicate elements from an array created via $_GET. I want users to be able to click on a link which sends an email address to an array. I just want to remove duplicate email addresses from the array. Ive tried array_unique() on my test server but it doesnt work. So i tried to remove duplicates myself before storing them into the array. The script works...
2
16272
by: Håvard Olerud Eriksen | last post by:
I've been working on a webshop, and I've got most of the functionality up and running. One problem, however, that I don't seem to be able to solve is as follows. My shopping cart is stored in $_SESSION array. As I need to keep tabs on what items are ordered and their quantity I add elements like this: array_push($_SESSION,array($item => $quantity)); If I add three elements and then var_dump the global variable it spits out: array(3) { =>...
5
10892
by: Rob Tweed | last post by:
Probably a simple question but I can't find the answer anyway. Specifically, is it possible to copy a multidimensional array into the $_SESSION array - ie a deep clone of all keys and data? I naively assumed that $_SESSION = $myArray ; would work but it doesn't appear to work. Is there a single function
3
4706
by: Michelle | last post by:
Hi all, I am trying to store data in a $_SESSION variable (an array), but it reverts to empty every time my page is refreshed (due to a submit button click). I read the answer to the post "$_SESSION comes empty on next page" dated 2/4, whaich seems to be my problem. But the suggestions do not help me at all <see 1 & 2 below> 1-have you set session.save_path ?
4
1800
by: iannorton | last post by:
Hi, I've spent most of today trying to solve this problem, but sadly no luck. I have an shopping basket based on an array which stores the name, product id, quantity and price for products, i want to take the Information in the array and output the Quantity and Product ID information into variables so that i can pass them into a Select Statement and submit the order to the database.
26
6268
by: drako | last post by:
Hi, I'm a bit stumped as I am getting a "Notice: Array to String Conversion" error when trying to do something that on the surface should be a very simple task - create an array, and write a set of values to them based on data submitted from POST Fields. Code below: $_SESSION = array();
2
3214
by: D. Susman | last post by:
Hi, I know that this issue is indeed strictly operating system dependent but I am just curious: I have a five dimensional array, whose size sums to 68 MB (almost). This array is contained by class X. When I simply attempt to create an instance of that class, I get segmentation fault. I am working on Solaris (which has 8 KB pages ). What may the case be?
1
2918
by: RYKLOU | last post by:
I am kinda new to php, but i do know what i am doing kinda, but i came across this error when i am trying to upload a file to my website. Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3714000 bytes) in /opt/lampp/htdocs/tutorials/php-mysql-tutorial/admin/image-gallery/library/functions.php on line 104 Platform: Ubuntu 8.04 LST (where i make my programs, and test them before i upload them), Using XAMPP for...
10
23740
by: orsula | last post by:
Hi Guys, I have a class A composed of several string and int members. I would like to manage a huge amount (several thousands) of A objects in a dictionary where each object has its unique key. Is there any known limitation or best practice that you think I should consider? Thanks,
0
7971
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8276
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8040
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3932
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2408
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1243
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.