Mogato Posted September 28, 2009 Share Posted September 28, 2009 Hi, I have a recently made a webbshop wich uses a session that stores all the products in an array (works fine), but then when I try to call the session/array it slows down the site... and it is the "session_start();" who does it. Below you find the code for my "shopping cart" which I include on all my sites and therefore make my whole site runs slowly anyone got any ideas of how to solve this problem? any easy way to get by this? //------------------------------------ // SHOPPING CART //------------------------------------ session_start(); session_register("products"); //Variables $products= $_SESSION[products]; //uppdaterar variabeln med nya sessionen $noitems = 0; if (isset($products)){ foreach($products as $k => $v){ $noitems += $products[$k]['noitems']; } } //------------------------------------ Quote Link to comment Share on other sites More sharing options...
Lyleyboy Posted September 28, 2009 Share Posted September 28, 2009 I would guess that you may need to have a word with your hosting company. Doesn't seem right that it should slow the whole site. I use sessions extensively and don't see any problems. Quote Link to comment Share on other sites More sharing options...
Mogato Posted September 28, 2009 Author Share Posted September 28, 2009 I would guess that you may need to have a word with your hosting company. Doesn't seem right that it should slow the whole site. I use sessions extensively and don't see any problems. OK... could it be because I run the site on a Widows-server? should I switch to UNIX instead? Quote Link to comment Share on other sites More sharing options...
Lyleyboy Posted September 28, 2009 Share Posted September 28, 2009 That shouldn't make a difference. Quote Link to comment Share on other sites More sharing options...
Mogato Posted September 28, 2009 Author Share Posted September 28, 2009 That shouldn't make a difference. Ok.. thanks! Quote Link to comment 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.