
August 14th, 2010, 09:49 AM
|
|
Registered User
|
|
Join Date: Aug 2010
Posts: 10
Time spent in forums: 2 h 2 m 36 sec
Reputation Power: 0
|
|
Depending on ur website if it is just html or is php you can use
w3schools
http://www.w3schools.com/JS/js_cookies.asp
which has some snippets
in said snippets has a getCookie(c_name) function
which you can use to get the cookie you are looking for...
Code:
<html>
<head>
<script type="text/javascript">
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}
</script>
</head>
<body>
<iframe src="<script>getCookie(url);</script>" extrastuff="here" onchange="setCookie(url,this.src,1"></iframe>
</body>
</html>
i'm hoping you get the idea...
i havn't tested the above coding but i'm sure you can figure what is going on there.
|