Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Detecting user log out


kevlev

Recommended Posts

Posted

I have inserted a horizontal menu from the general web site above the shopping carts menu. The menu works fine whether an end user is logged in or not. However, I want to prevent users returning to the main web site before logging out of the shopping cart. I have included Php and Javascript code to detect the GET array variable 'osCsid' and alert the end user to log out of the cart first, thus preventing them from returning to the main website. The only problem with this method of detection is that this variable still exists in the URL after one has logged out.

What cookies should I look for. Also if enforce cookies is disbabled how else can I determine when a customer logs out?

 

Any assistance would be greatly appreciated.

 

Regards,

Kevin.

Posted

you check for the customer_id session

 

if (!tep_session_is_registered('customer_id')) {
// customer not logged
}

 

and you don't do jscript stuff with sessions.

Posted
you check for the customer_id session

 

if (!tep_session_is_registered('customer_id')) {
// customer not logged
}

 

and you don't do jscript stuff with sessions.

 

 

I just found out how to do it by looking at the code in the login.php box and saw the code you mentioned above and it works perfectly. I use Php to determine if a session is active and then set a JScript parameter using echo statements. When a user clicks on the Jscript menu, the menu checks the parameter set by Php.

 

Regards,

Kevin

Archived

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

×
×
  • Create New...