Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

How do I use cookie for Locale and redirect according to Locale in LocaleEventListener in Symfony 3

$
0
0

I want to do override LocaleEventListener in Symfony 3 with the following scenario:

Scenario 1: I need to set Locale in Cookie say for example en|de

Scenario 2: Need to get requestUri = "/" and check if we have Locale in the cookie

Scenario 3: If we have Locale in the previous page ( e.g.: domain.com/en ) and now in the root domain ( e.g. domain.com )

then ==> redirect to domain.com/en

Result: So that user system can detect the previous language in the cookie and redirect to the user if hit on root domain

Purpose: Most users switch the language but sometimes they are opening a new tab with the main domain ( where we have default language ) - but users want their previous language.

How do I overcome this issue by fulfilling the purpose?

Thanks in Advance.


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>