Reputation: 1
After extensive research, I can't find the solution anyway for this, and it's frustrating and after days of smashing the keyboard, shouting at the sky and taking long meandering walks to calm down - we've all been there! But what's worse, I'm pretty sure my hairline has receded a fair bit from all this...
What I have found, either sniff out the IP to automatically redirect you or uses a form to set the cookie, non of which help, unfortunately.
I've tried and tried to get something working but I just can't get my head around this one.
Help me Obi Wan Kenobi your my only hope, thank you!
Upvotes: 0
Views: 793
Reputation: 31467
First of all you need to identify the user. The easiest way is to store an HTTP cookie in the visitors' browser.
You can set this with PHP, JavaScript, it does not matter because the stored cookie will be the same regardless of the method you select. But you need to aware of that the maximal age of the HTTP cookie needs to be set to a month or so.
On the second visit you check the stored cookie on the server side and redirects the user to the selected page (but keep in mind that an option should be there to change this first decision).
So, the steps:
$_COOKIE
array in PHP)setcookie
for exampleheader("Location ...")
redirectUpvotes: 1