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']; } } //------------------------------------ Link to comment https://forums.phpfreaks.com/topic/175765-session_start-makes-site-run-slowly/ 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. Link to comment https://forums.phpfreaks.com/topic/175765-session_start-makes-site-run-slowly/#findComment-926231 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? Link to comment https://forums.phpfreaks.com/topic/175765-session_start-makes-site-run-slowly/#findComment-926233 Share on other sites More sharing options...
Lyleyboy Posted September 28, 2009 Share Posted September 28, 2009 That shouldn't make a difference. Link to comment https://forums.phpfreaks.com/topic/175765-session_start-makes-site-run-slowly/#findComment-926234 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! Link to comment https://forums.phpfreaks.com/topic/175765-session_start-makes-site-run-slowly/#findComment-926237 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.