Dim KeyExists Function SetCookie(sKey, sValue) Dim ck ck = sKey & "=" & sValue ck = ck & ";Expires=Fri 01-Jan-2050 13:00:00 GMT" Document.Cookie = ck End Function Function GetCookie(sKey) KeyExists = True Dim iLoc iLoc = Instr(Document.Cookie, sKey) If iLoc = 0 Then GetCookie = "" KeyExists = False Else Dim sTemp sTemp= Right(Document.Cookie, Len(Document.Cookie) - iLoc +1) Dim iKeyLen iKeyLen = Len(sKey) If Mid(sTemp, iKeyLen + 1, 1) <> "=" Then GetCookie = "" KeyExists = False Else Dim iNextStep iNextStep = Instr(sTemp, ";") If iNextStep = 0 Then iNextStep = Len(sTemp) + 1 If iNextStep = (iKeyLen + 2) Then GetCookie = "" Else Dim iValLen iValLen = iNextStep - iKeyLen - 2 GetCookie = Mid(sTemp, iKeyLen + 2, IValLen) End If End If End If End Function Function DeleteCookie(sKey) Document.Cookie = sKey & "=NULL;Expires=Fri 01-Jan-1980 13:00:00 GMT" End Function