rgplanet Posted May 18, 2009 Posted May 18, 2009 Hi, I continue step by step with the Oscommerce site. Now, I have a strange problem. When I go to the page with the clean cache, it says: Warning: Invalid argument supplied for foreach() in /home8/sendapac/public_html/catalog/includes/functions/sessions.php The code in sessions.php in these lines (109-115) is: // Register Globals MOD - http://www.magic-seo-url.com function tep_session_close() { foreach($_SESSION as $key => $value) { global $$key; $_SESSION[$key] = $$key; } } The problem is that in Safari (mac) it doesnt appear and in windows, the first time appear and, when you refresh, it dissapear. You can see it in http://www.sendapackage.com Thanks in advance, Roger.
morehawes Posted May 19, 2009 Posted May 19, 2009 Hi, it appears that you are trying to access the session variable before it is created which would explain why the second time you load the page the error does not display. I have NO knowlege of yuor setup or the contribution you are using but a workaround would be to check if the $_SESSION variable exists before you try to access it like this: function tep_session_close() { if(isset($_SESSION)) { foreach($_SESSION as $key => $value) { global $$key; $_SESSION[$key] = $$key; } } } This should stop the error but you need to get to the route of it to make sure there isn't a problem else where. A start might be to find where the function is getting called from in this case. Joe MacMan strikes again! Always backup first before listening to me!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.