Hey thanks Shunga. I got it.
=========================
AuthGroupFile /dev/null
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*domain.com/.* [NC]
RewriteCond %{HTTP_REFERER} !^http://111.222.333.444/.* [NC]
RewriteCond %{HTTP_COOKIE} !(^|(.+

*)id=valid(;.

*|$)
RewriteRule /*
http://www.redirect-domain.com/ [R,L]
=============================
And insert this code in html page, between <head></head>
=============================
<SCRIPT LANGUAGE="javascript">
// Calculate the expiration date
var expires = new Date ();
expires.setTime(expires.getTime() + 6 * 60 * 60 * 1000);
document.cookie = "id=valid; path=/" + "; expires=" + expires.toGMTString();
</SCRIPT>
=============================