Renlok Posted March 26, 2009 Share Posted March 26, 2009 Im a developer of an auction script and one of the users has reported the sessions not working properly on his server like when a session is set on the next page it isnt there when it should be. Could anyone give me some ideas of why this may be happening Link to comment https://forums.phpfreaks.com/topic/151256-_session/ Share on other sites More sharing options...
revraz Posted March 26, 2009 Share Posted March 26, 2009 Not without seeing how you set the session. Could be a domain parameter issue. Link to comment https://forums.phpfreaks.com/topic/151256-_session/#findComment-794553 Share on other sites More sharing options...
Renlok Posted March 26, 2009 Author Share Posted March 26, 2009 just like session_start(); $_SESSION['this'] = 'that'; then you get to the next page by submitting a form Link to comment https://forums.phpfreaks.com/topic/151256-_session/#findComment-794563 Share on other sites More sharing options...
waynew Posted March 26, 2009 Share Posted March 26, 2009 Have you tried to do some debugging? Have any specific errors shown up? Link to comment https://forums.phpfreaks.com/topic/151256-_session/#findComment-794568 Share on other sites More sharing options...
revraz Posted March 26, 2009 Share Posted March 26, 2009 Make sure when you move from page to page, you use Relative links and not Absolute. If you set the session on say mysite.com and then navigate them to www.mysite.com, that is considered another domain and the session isn't passed. So see if that is the problem. Link to comment https://forums.phpfreaks.com/topic/151256-_session/#findComment-794610 Share on other sites More sharing options...
Renlok Posted March 27, 2009 Author Share Posted March 27, 2009 its something to do with the function function addauction(){ global $DBPrefix, $_SESSION, $userrec, $a_starts, $a_ends, $payment_text, $system; return "INSERT INTO " . $DBPrefix . "auctions VALUES (NULL, " . $userrec['id'] . ", '" . $system->cleanvars($_SESSION['SELL_title']) . "', '" . $a_starts . "', '" . addslashes($_SESSION['SELL_description']) . "', '" . $system->cleanvars($_SESSION['SELL_pict_url']) . "', " . $_SESSION['SELL_sellcat'] . ", '" . $_SESSION['SELL_minimum_bid'] . "', '" . $_SESSION['SELL_shipping_cost'] . "', '" . (($_SESSION['SELL_with_reserve']=="yes")?$_SESSION['SELL_reserve_price']:"0") . "', '" . (($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" . $_SESSION['SELL_atype'] . "', '" . $_SESSION['SELL_duration'] . "', " . floatval($_SESSION['SELL_customincrement']) . ", '" . $_SESSION['SELL_shipping'] . "', '" . $payment_text . "', " . (($_SESSION['SELL_international']) ? 1 : 0) . ", '" . $a_ends . "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 1 : 0) . ", " . $_SESSION['SELL_iquantity'] . ", 0, 'n', " . intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" . $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" . $_SESSION['SELL_buy_now_only'] . "', '" . $_SESSION['SELL_adultonly'] . "')"; } as if i put print_r($_SESSION); before i call the function it displays al the sessions but if i put it inside the function nothing shows. Link to comment https://forums.phpfreaks.com/topic/151256-_session/#findComment-795210 Share on other sites More sharing options...
mrMarcus Posted March 27, 2009 Share Posted March 27, 2009 its something to do with the function function addauction(){ global $DBPrefix, $_SESSION, $userrec, $a_starts, $a_ends, $payment_text, $system; return "INSERT INTO " . $DBPrefix . "auctions VALUES (NULL, " . $userrec['id'] . ", '" . $system->cleanvars($_SESSION['SELL_title']) . "', '" . $a_starts . "', '" . addslashes($_SESSION['SELL_description']) . "', '" . $system->cleanvars($_SESSION['SELL_pict_url']) . "', " . $_SESSION['SELL_sellcat'] . ", '" . $_SESSION['SELL_minimum_bid'] . "', '" . $_SESSION['SELL_shipping_cost'] . "', '" . (($_SESSION['SELL_with_reserve']=="yes")?$_SESSION['SELL_reserve_price']:"0") . "', '" . (($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" . $_SESSION['SELL_atype'] . "', '" . $_SESSION['SELL_duration'] . "', " . floatval($_SESSION['SELL_customincrement']) . ", '" . $_SESSION['SELL_shipping'] . "', '" . $payment_text . "', " . (($_SESSION['SELL_international']) ? 1 : 0) . ", '" . $a_ends . "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 1 : 0) . ", " . $_SESSION['SELL_iquantity'] . ", 0, 'n', " . intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" . $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" . $_SESSION['SELL_buy_now_only'] . "', '" . $_SESSION['SELL_adultonly'] . "')"; } as if i put print_r($_SESSION); before i call the function it displays al the sessions but if i put it inside the function nothing shows. at any point in the script are you calling the function addauction()? becuase yes, if you have "print_r($_SESSION);" before the function it will be printed whether you call the function addauction() or not. just a thought. Link to comment https://forums.phpfreaks.com/topic/151256-_session/#findComment-795323 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.