Bobo
12-29-2004, 06:05 PM
For a site of mine, I'm using a log-in script. It uses cookies and location.search to remember the user's name. The cookies, however, are not saving at all.
I know my browser is allowing all cookies because this site is using them successfully after I cleared them all.
The script is as follows:
<script language="VBScript">
Dim dataa
Sub Egg()
dataa=inputBox("hi","hi")
ret(dataa)
End Sub
</script>
<script language=Javascript>
var Username='',temp='',other='',Dat=new Date(),reset=false;
function Init()
{
if (document.cookie)
{
temp=document.cookie.split('=');
Username=unescape(temp[1]);
reset=false;
ret(Username);
}
else
{
reset=true;
Egg()
}
}
function ret(name)
{
Username=name;
// alert(Username)
Dat.setTime(Dat.getTime()+(7*24*60*60*1000));
if (reset&&Username!=undefined&&Username!='')
{
document.coookie="user="+escape(Username)+";expires="+Dat.toGMTString()+";";
}
else if (Username==undefined||Username=='')
{
Username='guest'
}
// alert(Username+reset+temp[0]+Dat+'\n\b'+document.cookie)
parent.location.search=Username
}
window.onload=Init
</script>
Can anyone find the problem? I've trying to fiqure it out for the past hour! :confused:
I know my browser is allowing all cookies because this site is using them successfully after I cleared them all.
The script is as follows:
<script language="VBScript">
Dim dataa
Sub Egg()
dataa=inputBox("hi","hi")
ret(dataa)
End Sub
</script>
<script language=Javascript>
var Username='',temp='',other='',Dat=new Date(),reset=false;
function Init()
{
if (document.cookie)
{
temp=document.cookie.split('=');
Username=unescape(temp[1]);
reset=false;
ret(Username);
}
else
{
reset=true;
Egg()
}
}
function ret(name)
{
Username=name;
// alert(Username)
Dat.setTime(Dat.getTime()+(7*24*60*60*1000));
if (reset&&Username!=undefined&&Username!='')
{
document.coookie="user="+escape(Username)+";expires="+Dat.toGMTString()+";";
}
else if (Username==undefined||Username=='')
{
Username='guest'
}
// alert(Username+reset+temp[0]+Dat+'\n\b'+document.cookie)
parent.location.search=Username
}
window.onload=Init
</script>
Can anyone find the problem? I've trying to fiqure it out for the past hour! :confused: