S
S
Shark21212017-08-07 14:08:42
css
Shark2121, 2017-08-07 14:08:42

How to remember the choice of the region on the site?

I have a site on which I want to implement the selection of the desired region.
As I imagine it:
When a person visits the site for the first time, we show a pop-up window with the text: Select your region. Now there are two regions Odessa and Kyiv. We have Odessa at moysite.com, and Kyiv at moysite.com/kiev
How can I show the page that the person has chosen on re-entry and not show a pop-up window every time? For example, if he chose Kyiv, then what would redirect him to the page moysite.com/kiev when he enters the main page

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
RAX7, 2019-03-20
@Wekeed

D
datka, 2019-03-20
@datka

animation: A-StepsLC 3s ease-in-out;
change to
animation: A-StepsLC 10s ease-in-out;

D
D3lphi, 2017-08-07
@Shark2121

When a person enters the site, check if a cookie (or an element in localstorage) exists and if it contains a valid region name, if yes - redirect the user to the desired page, no - show a window in which you ask him to select a region and write the name of this region to the cookie (or an element in localstorage) and also redirect to the page with the desired region.

E
entermix, 2017-08-07
@entermix

You need to write the selected region to the storage, for example, in cookies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question