I have a page (lets say index.php) where user choose language
On very top of it there is such php code:
<?php if ( $_COOKIE['langSet'] == 'english') header("Location: http://www.mysite1.com"); elseif ( $_COOKIE['langSet'] == 'german') header("Location: http://www.mysite2.com"); ?>
If choosing, for example, english, he would be sent to www.mysite1.com/main.php
where on very top is a code:
<?php $lang = 'english'; setcookie("langSet", $lang, time() + (86400*30), "/"); ?>
Idea is that next time user goes to the page where he must choose language, he is
redirected to the appropriate one he choose before.
1) How do I make cookie not to dissapear after browser is closed?
2) How do I make possibility for user to still be able to go back to language selection page
after he choose language and the cookie is set? By now I have made a 'middle' page where cookie
is unset after what user gets redirected to language selection page. Is there another way?
3) How do I refresh the page which sets the cookie, so it's value can be used immediately?
Oh please... I am googling around trying to find answers, but can't find a solution on this one..
at least one that works
Thank you guys in advance!