Return to specific locale based on cookie?
Storing the cookie

I'd recommend using the LJ Cookies plugin...

{% do craft.lj_cookies.set('locale', craft.locale, '', '/' ) %}


Retrieving the cookie

The LJ Cookies plugin is also capable of reading cookies, so you could simply put a conditional redirect at the top of your layout...

{% set currentLocale = craft.locale %}
{% set goToLocale = craft.lj_cookies.get('locale') %}

{% if goToLocale and (currentLocale != goToLocale %}
    {% redirect '/' ~ goToLocale %}
{% endif %}


If you insist on performing the locale redirect at the .htaccess level, that's also possible. It would provide you a small performance improvement, but may not be worth bypassing the simplicity of using LJ Cookies in your template.

Using .htaccess to perform a redirect based on a cookie value is beyond my expertise, and somewhat beyond the scope of the Craft SE site. But I did some quick Googling around for "cookie" and "htaccess", and found a few helpful links:


https://stackoverflow.com/questions/3978726/how-to-do-htaccess-redirect-based-on-cookie-value
http://www.askapache.com/htaccess/htaccess-fresh.html#Get_Cookie_Value