OK then to have this set in a cookie like you have requested you would need to change the header script to being:
Code:
<?php
if(!empty($_POST['id'])){setcookie("affid",$_POST['id']);} #<-- Sets the affiliate id
{$affid = $_COOKIE['affid'];} #<-- assign affiliate id
if(empty($_COOKIE['affid'])){$affid = "xxxxxx";} #<-- add a default value
?>
This will set a cookie for the user instead of storing the value within a session on the server
Hope this helps. Please feel free to ask if you have any other questions
Rob