Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Auto Logout -- How to set session length?


TerryK

Recommended Posts

I haven't been able to find anything about this through my searches of "session timeout" " session logout" and other related keywords...

 

I was monkeying around with the code for my store tonight while logged in as a customer. At one point, I got buried in the code, and it was probably 10-15 minutes before I went back to refresh the page and check my code changes. Instead of updating the page, I was redirected to the customer login page where I had to sign in again as a customer.

 

Some of my customers start shopping in the morning, and don't finish until hours later. Is there somewhere I can change the code which allows them a longer login session before timing out?

 

Thanks in advance for any help!

 

TerryK

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

I am not very sure about this. But, if I am not wrong, the timeout setting should be in catalog/includes/functions/sessions.php.

 

Try searching for the following lines at about lines 13 -16:

 

if (STORE_SESSIONS == 'mysql') {

if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {

$SESS_LIFE = 1440;

}

 

Changing the $SESS_LIFE to a larger value should gives you a longer login session.

Link to comment
Share on other sites

  • 3 weeks later...

I've seen customers complain their shopping cart is empty when in fact all thats happening is they are newly logged out and are a guest but dont realize it because they are on the cart contents page with no warning they are actually not logged in.

 

I fixed this by adding code to the catalog/shopping_cart.php page just before the line that displays

HEADING_TITLE. I added:

 

<td class="main"><?php echo tep_customer_greeting_cart(); ?></td>

 

where the above function is very similar to the code of catalog/includes/functions/general.php function tep_customer_greeting().

 

This will say who they are logged in as or if they are a guest, and ask them if they want to log in if the latter is the case.

 

Of course it also helps to beef up the length of a session as well.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...