I decided to write the script:
1. User chose some language
2. Language is saving into cookies
3. When user comes to site again language is reading from cookies and script redirects user to destination URL which contains the language code
Saving language parameter in cookies and redirecting are OK but redirected page is blank. When I delete the saved cookie and reload the page it has content.