Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dropping Sessions


paq1200

Recommended Posts

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

Link to comment
Share on other sites

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 when

you 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";

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by diy
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...