- I want to create a simple affiliate code.
Currently I use PHP session to keep the affiliate ID.
http://domain.com/aff.php?id=123
$_SESSION['referral'] = intval($_GET['id']);
The problem now. Example user logged to affiliate area then logout, the $_SESSION['referral']
will unset & destroyed by session_unset() session_destroy()
on logout.php
So now the affiliate ID
no more on the page. So we need to retype the URL to get the ID sticked on the whole web pages.
Question
How to make the affiliate id
id=123
will be on the browser although session already destroyed. Unless user clear the browser cache.