Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Session is not working as it should


Dennis_gull

Recommended Posts

So I tried both oscommerce 2.2 (latest on github) and 3.0 alpha 5 and both of them give me different problems, lets start with osc 2.2:

  1. I can't register a new user, once I click continue for the register form I will just end up back at the register form.
  2. I can't add items to the shopping cart, once I click "add to cart" I will just get redirected to an empty cart.

However I can still login in on the admin section without any problems, so I'm not sure whats wrong here.

 

osc 3.0 alpha 5:

  1. I can't login on the admin page, once I type the correct login details I will just get redirected back to the login page, the $_SESSION['admin'] is also NULL again.
  2. Same as before, I can't add items to the shopping cart, once I click "add to cart" I will just get redirected to an empty cart.

 

Anyone else experiencing my problems?

 

Note:

I'm working on a localhost using WAMP with php 5.3

Link to comment
Share on other sites

I found out why I couldn't login on the admin page on osc 3.0 alpha 5, however I'm not sure how to solve the problem. Every time i refresh the page a new session is created in the database so even though I login the page try to select a new session once I reload the page, here is the lines in includes/classes/session/database.php (starting on line 65)

 

protected function _custom_read($id) {
     global $osC_Database;

     $Qsession = $osC_Database->query('select value from :table_sessions where id = :id'); // This id should be the same but It refeshes every time I

     if ( $this->_life_time > 0 ) {
       $Qsession->appendQuery('and expiry >= :expiry');
       $Qsession->bindInt(':expiry', time());
     }

     $Qsession->bindTable(':table_sessions', TABLE_SESSIONS);
     $Qsession->bindValue(':id', $id);
     $Qsession->execute();

     if ( $Qsession->numberOfRows() === 1 ) {
       return $Qsession->value('value');
     }

     return false;
   }

I can't figure out where custom_read is called and why the id isn't that same, would really like some help here!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...