having this request :
// set a cookie to requested locale
app.get('setlocale/:locale', function (req, res) {
res.cookie('locale', req.params.locale); //set language in cookie
if(req.param.locale === "es"){
res.redirect('/es'); //i'm redirecting depending on the url
// this could also redirect to
// res.redirect('/es/terms');
...
}
});
this request is triggered by a selector list like
<ul class="dropdown-menu" role="menu">
<li class="uppercase"><a rel="" href="/setlocale/es/">ES</a></li>
<li class="uppercase"><a rel="" href="/setlocale/de/">DE</a></li>
<li class="uppercase"><a rel="" href="/setlocale/en/">EN</a></li>
</ul>
What is the right header status code following good practices should return in this request? . considering is redirecting to "http://example.com/es" or "http://example.com/de" or "http://example.com/de/terms" after changing a cookie language. and if I have to set a status , where and how it would be set in this request.
thanks.