paq1200 Posted January 14, 2009 Share Posted January 14, 2009 This has been asked several times with no answer. how do I keep the session from one page to the next? I have added a contribution which allows you to sort the products by dropdown but when you go to the next page the session is dropped. this is the code on the index.php: echo '<td align="center" class="dynamicMain">' . tep_draw_form('sort', FILENAME_DEFAULT, 'get') . '<b>Sort by:</b> '; if (isset($HTTP_GET_VARS['manufacturers_id'])) { echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']); } else { echo tep_draw_hidden_field('cPath', $cPath); } $sort_list = array('6d' => 'Best Sellers', '2a' => 'Products Name A to Z', '2d' => 'Products Name Z to A', '3a' => 'Price Low to High', '3d' => 'Price High to Low'); foreach($sort_list as $id=>$text) { $sort_range[] = array('id' => $id, 'text' => $text); } echo tep_draw_pull_down_menu('sort', $sort_range, (isset($HTTP_GET_VARS['sort']) ? $HTTP_GET_VARS['sort'] : ''), 'onchange="this.form.submit()"'); echo tep_draw_hidden_field('filter_id', (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : '')); echo '</form></td>' . "\n"; // End Additional Products Sort Any help is appreciated Mike Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted January 14, 2009 Share Posted January 14, 2009 This has been asked several times with no answer. how do I keep the session from one page to the next? A question that can not be answered in general so saying "this has been asked several times with no answer" implies a problem with the way the question was asked IMO. I have added a contribution which allows you to sort the products by dropdown but whenyou go to the next page the session is dropped. See above. In general this does not happen, only when your browser does not accept cookies or the site setup is so that the osCsid is always in the url. In that case (and you don't give us a url to check) it might be because the code for the dropdown does not add the osCsid to the get variables as in this example from index.php: echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); echo tep_hide_session_id() . '</form></td>' . "\n"; Quote Link to comment Share on other sites More sharing options...
paq1200 Posted January 15, 2009 Author Share Posted January 15, 2009 A question that can not be answered in general so saying "this has been asked several times with no answer" implies a problem with the way the question was asked IMO. See above. In general this does not happen, only when your browser does not accept cookies or the site setup is so that the osCsid is always in the url. In that case (and you don't give us a url to check) it might be because the code for the dropdown does not add the osCsid to the get variables as in this example from index.php: echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); echo tep_hide_session_id() . '</form></td>' . "\n"; Sorry about the way the question was asked. What I was refering to when I said "this has been asked several times with no answer" was that in the contributions forum that question was asked several times and no one answered it in the forum. That is why I put it as a new topic. I am still learning php and I do not know what I should do here. you can see what I am talking about HERE. signon:[email protected] password:trial when you go to All Products then change the sort by and you will be logged off. and the session will not be in the address bar. Thanks Mike Quote Link to comment Share on other sites More sharing options...
diy Posted January 15, 2009 Share Posted January 15, 2009 (edited) Dont quite undestand what you mean with the dropdown but the problem I see is that the cart is not stored (if you place a prod on the cart and close the window the cart is lost when you return) What I know is that sessions are set in the configure.php file where you set define('STORE_SESSIONS', 'mysql'); or set define('STORE_SESSIONS', 'l'); but you will have to create an extra folder with name tmp Edited January 15, 2009 by diy Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted January 15, 2009 Share Posted January 15, 2009 when you go to All Products then change the sort by and you will be logged off. and the session will not be in the address bar. That the session id is not in the address bar is because of the echo tep_hide_session_id() not being added (see above). However, without logging-in I can see that the osCsid stays in the url and links all the time. Your site doesn't set or isn't able to set cookies. Perhaps a configuration error in configure.php. 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.