<?php
/*
	Stempora Web Framework
	Copyright (c) 2002-2016 Stempora. 
	All rights reserved.
		web:  www.stempora.com
		mail: support@stempora.com		
*/

// dependencies

global $_SESS;



	if ($_COOKIE["uref"]) {

		//do nothing, the referal its allready takedn by somebody else
	} else {		

		if (stristr($_SERVER["HTTP_REFERER"] , $_SERVER["HTTP_HOST"])) {

		} else {		
			//expire in 30 days;
			$expire = time() + 3600*24*365;

			//set the referer	
			setcookie ( 
					"uref" , 
					$_SERVER["HTTP_REFERER"],
					$expire,
					"/", 
					false
			);	
		}
	}

?>
