set cookie to remember language choice
I have a dual language website (English/Russian) which has a language selection dropdown in the header of every page:
<ul>
<li class="active"><a href="/en/<?php echo basename($_SERVER['PHP_SELF'])?>">ENGLISH</a></li>
<li><a href="/ru/<?php echo basename($_SERVER['PHP_SELF'])?>">РУССКИЙ</a></li>
</ul>
Visitors are currently automatically redirected to domain.com/en/ via the .htaccess file:
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ en [L]
If the visitor then chooses Russian, how would I go about setting a cookie to remember this choice for their next visit? Would I
need to alter the .htaccess file as well?