Is there a problem with cookies on the servers?

I am using cookies on my site and get the following error on one of my pages.

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Response.Cookies(...)'

The code causing this is:

Code:
Set dbRecSet = Server.CreateObject("ADODB.RecordSet")
dbSQLStr = "SELECT tblMembers.member_name FROM tblMembers WHERE member_name = '" & strUname & "';"
dbRecSet.Open dbSQLStr, dbConStr
If dbRecSet.EOF Then
	blnRegOK = True
Else
	dbRecSet.Close
	Set dbRecSet = Nothing
	blnRegOK = False
	Response.Cookies("TMPCKI")("FormUname").Value = strUname
	Response.Cookies("TMPCKI")("FormEmail").Value = strEmail
	Response.Cookies("TMPCKI")("FormEmail2").Value = strEmail2
	Response.Redirect("http://www.hammerfist.net/members/register/form/?FixUname=True")
End If

Interestingly I have an include on all my pages that also uses cookies but has never thrown an error.

Code:
If Session("dtmLastVisit") = "" AND Request.Cookies("HMRCKI")("LTVST") <> "" Then
	Session("dtmLastVisit") = CDate(Request.Cookies("HMRCKI")("LTVST"))
	Response.Cookies("HMRCKI")("LTVST") = CDbl(Now())
	Response.Cookies("HMRCKI").Expires = DateAdd("yyyy", 1, Now())
ElseIf Session("dtmLastVisit") = "" Then
	Session("dtmLastVisit") = Now()
End If

If isNumeric(Request.Cookies("HMRCKI")("LTVST")) Then
	If CDate(Request.Cookies("HMRCKI")("LTVST")) < DateAdd("n", -5, Now()) Then
		Response.Cookies("HMRCKI")("LTVST") = CDbl(Now())
		Response.Cookies("HMRCKI").Expires = DateAdd("yyyy", 1, Now())
	End If
Else
	Response.Cookies("HMRCKI")("LTVST") = CDbl(Now())
	Response.Cookies("HMRCKI").Expires = DateAdd("yyyy", 1, Now())
End If

I have tried everything and am at a loss as to what the problem is, any help would be greatly appreciated!
 
You are using an extra property that isnt supposed to be there. Here's what you need instead of the first code you posted:
Code:
Set dbRecSet = Server.CreateObject("ADODB.RecordSet")
dbSQLStr = "SELECT tblMembers.member_name FROM tblMembers WHERE member_name = '" & strUname & "';"
dbRecSet.Open dbSQLStr, dbConStr
If dbRecSet.EOF Then
	blnRegOK = True
Else
	dbRecSet.Close
	Set dbRecSet = Nothing
	blnRegOK = False
	Response.Cookies("TMPCKI")("FormUname") = strUname
	Response.Cookies("TMPCKI")("FormEmail") = strEmail
	Response.Cookies("TMPCKI")("FormEmail2") = strEmail2
	Response.Redirect("http://www.hammerfist.net/members/register/form/?FixUname=True")
End If

The property that didn't exist was the '.Value' property. ASP doesnt use that.
 
Back
Top