Forums / General Questions / Some times page switches to default language when refreshed after inactivity

Some times page switches to default language when refreshed after inactivity

Locked

Views: 928

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
27 Aug 2010, 2:36 PM
#1
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Some times page switches to default language when refreshed after inactivity

Not a major issue, but one anyway and I wonder if someone could offer help.

I have two languages installed, English and Greek with Greek being the default. Therefore, if one enters the site by using the URL http//athenscollectibles.info, the site comes up in Greek. Everything works fine and the user can switch between English and Greek on any page by using the flags in the header bar.

The problem starts when the visitor refreshes a page or selects another page after some time of inactivity. For example, someone visits the English "About us" page, leaves it unchanged for an hour and then clicks on Home or something else. Then, instead of getting the English Home page, the default Greek Home page is presented.

I suspect that it may have to do with cookies expiring (or am I talking nonsense?) but a more valid explanation and a remedy can be offered by one of the experts around the forums.

Help will be much appreciated and thanks are expressed in advance.

27 Aug 2010, 8:37 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Some times page switches to default language when refreshed after inactivity

That's by design.
The visitor's choice is remembered for as long as they are active on the site. If they're inactive for more than 24 minutes, their selections are reset.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Aug 2010, 9:53 AM
#3
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Some times page switches to default language when refreshed after inactivity

Thank you DrByte. It seems that I was correct about something expiring, it wasn't cookies but session.

Following your post, I searched the forums for "24 minutes" and found where the session information is. I could change it to something like 1 hour but there are conflicting opinions about this, which make it difficult to decide. :unsure:

28 Aug 2010, 9:57 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Some times page switches to default language when refreshed after inactivity

If you've read my posts about the topic then you'll know that I recommend leaving it alone.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Aug 2010, 10:10 AM
#5
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Some times page switches to default language when refreshed after inactivity

That I will do, but will also change my default language to English as most visitors are expected to be English-speaking.

Thanks again and wishes for a nice weekend. :smile:

2 Sep 2010, 1:58 PM
#6
batman42ca avatar

batman42ca

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Re: Some times page switches to default language when refreshed after inactivity

DrByte:

The visitor's choice is remembered for as long as they are active on the site. If they're inactive for more than 24 minutes, their selections are reset.

Does this mean that every time a visitor returns to the site (perhaps days later) they have to select their language preference again?

Is the language of choice not saved in a cookie? If not, do I have to create my own cookie and set $_SESSION['language'] (based on the cookie value) immediately after

require('includes/application_top.php');

in index.php