How To Keep The Recently Viewed For 1 Month?

Hello



Does some one know how to keep the recently viewed for 1 month in the customer computer? because now all products of recently viewed can keep only for one day, next day, everything are lost, it's restart a new recently product, I need to keep on customer computer for around 1 month.



I use the cs cart default recently viewed function on all product pages, my website is multi vendor with 4.2.3



Thank in advance!



Franck

Information about recently viewed is stored in the session. So it is required to edit the value of the session live time in the config.php file:



define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * 2); // 2 hours

[quote name='eComLabs' timestamp='1424262826' post='205652']

Information about recently viewed is stored in the session. So it is required to edit the value of the session live time in the config.php file:



define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * 2); // 2 hours


[/quote]Dear



So if I need to keep for each buyer to keep the recently viewed for one month, do I just need change the 2 hours to: 720 hours?



Thank

For security reasons, suggest you do it like:

define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * (AREA == 'A' ? 2 : 720));

This will keep the session time of the admin to 2 hours and increase it for customers only.

[quote name='Enew' timestamp='1424281990' post='205727']

So if I need to keep for each buyer to keep the recently viewed for one month, do I just need change the 2 hours to: 720 hours?

[/quote]



You are right, please use tbirnseth solution

[quote name='eComLabs' timestamp='1424344476' post='205817']

You are right, please use tbirnseth solution

[/quote]Hi, what is tbirnseth [color=#282828][font=arial, verdana, tahoma, sans-serif]solution? how to use?[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Thank[/font][/color]

[quote name='Enew' timestamp='1424365170' post='205895']

Hi, what is tbirnseth [color=#282828][font=arial, verdana, tahoma, sans-serif]solution? how to use?[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Thank[/font][/color]

[/quote]



You can open the config.php file and change:



define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * 2);




To



define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * (AREA == 'A' ? 2 : 720));

[quote name='cscartrocks' timestamp='1424365416' post='205896']

You can open the config.php file and change:

[/quote]



Right! Enew, please check post #4

You can open the config.php file and change:

define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * 2);
To

define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * (AREA == 'A' ? 2 : 720));

this worked however API requests from a 3rd party app (Aftership) started to fail. This was added to the JSON string "Use of undefined constant AREA"

Try this code:

define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * ((defined('AREA') && AREA == 'C') ? 720 : 2));

Try this code:

define('SESSION_ALIVE_TIME', SECONDS_IN_HOUR * ((defined('AREA') && AREA == 'C') ? 720 : 2));

This worked :)