Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Session Cookie Hack


Recommended Posts

Hi all,


When we enable "Force Cookie Use" on localhost server, we can not login to our account. It's because session.cookie_domain will not work on localhost domain.


To make it work, simply remove session.cookie_domain for localhost.


(Base on oscommerce-2.2rc2a, but also maybe valid for older version)


Open: /catalog/application_top.php

Line: around line 118-119 add following RED code...


// set the cookie domain
 $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
 $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);
[color="#FF0000"][b]  if (preg_match('@^([0-9]+\.|localhost)@i', $cookie_domain)) {
$cookie_domain = '';



Enjoy your day,


Link to comment
Share on other sites


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

  • Create New...