Jump to content

Recommended Posts

I have a couple of tables that I store in the following global arrays.

 

$_SESSION['menu_table'] = $menu_table;

 

$_SESSION['ingredients_tablet'] = $ingredients_table;

 

The tables contain meal choices and the ingredients respectively. The meals and ingredients are selected from a mysql db.

 

The tables can vary in size. Users can select up to 12 days of food and ingredients to be displayed. The biggest table is about 1500 lines of html long. The other table is much smaller.

 

However, once 12 days has been selected the contents of the second array ( whichever one is furthest down the page,  $_SESSION['ingredients_tablet'] in the example above.) is destroyed when it is passed on to the next file. The output of var_dump($_SESSION['ingredients_tablet']); is NULL. If I move the array up the file the other array becomes NULL. The file I am passing the arrays on to is a test file. There is nothing on it that would destroy the session.

 

It is not a db issue. The variables in the tables are the same. The meal table is just a simplified version of the other. Both tables display flawlessly on the original file, and both arrays are set and output properly when they are checked with var_dump() on the originating file.

 

The site is running on localhost right now.

 

The memory limit is set to 256M in my php.ini. I don't know if that has anything to do with it.

 

I am self taught so there are lots of holes in my php knowledge. Can anybody tell me what is going on? I was planning on giving users the option of selecting up to 14 days. Am I going to be limited to 11?

 

 

Link to comment
https://forums.phpfreaks.com/topic/200201-_session-seems-to-max-out/
Share on other sites

The code on the test page is this. I am trying to embed this in osCommerce, which is the source of the two 'require' files. The top one starts sessions and initializes the db connection. I am not sure of the purpose of the bottom file.

 

<?php

require('includes/application_top.php');

 

var_dump($_SESSION['menu_table']);

echo "<br />";

var_dump($_SESSION['ingredient_table']);

 

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

The contents of the require files is pretty esoteric. Could there be something in there? Why does it pass on the content of smaller files?

 

Which one retains the content and which one is set to NULL depends on their order on  the originating file.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.