darp Posted April 29, 2010 Share Posted April 29, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/200201-_session-seems-to-max-out/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 29, 2010 Share Posted April 29, 2010 You probably have a logic error in your code on the page that is setting the session variable to an empty value. The quickest solution would be for you to post the code on the page. Quote Link to comment https://forums.phpfreaks.com/topic/200201-_session-seems-to-max-out/#findComment-1050660 Share on other sites More sharing options...
darp Posted April 29, 2010 Author Share Posted April 29, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/200201-_session-seems-to-max-out/#findComment-1050676 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.