Click to See Complete Forum and Search --> : Problem With Cookies


weee
02-26-2004, 02:40 PM
I'm getting this error:
Cookies object error 'ASP 0102 : 80004005'

Expecting string input

log.asp, line 16

The function expects a string as input.


Response.Cookies(C_CookieName)("User") = rs("User")
Response.Cookies(C_CookieName)("aUser") = Request("Username")
Response.Cookies(C_CookieName)("aPswd") = Request("Password")
Response.Cookies(C_CookieName).expires = date + 30

Why is that?

tomhartland
02-27-2004, 09:08 AM
It would be useful to know which line 16 is.
(Also, could it possible that the "user" field in the recordset is null?)

buntine
02-27-2004, 09:19 AM
You are using dictionary cookies. They can put strain on the server and client. Most servers will limit the amount of data you can store on the clients machine.

What is the value of C_CookieName?
What is the value of date?

Finally, you should use Request.method("") rather than just request(""). If your page uses both POST and GET than you can use a member of the serverVariables collection to determine which method to use.

if UCase(request.serverVariables("REQUEST_METHOD")) = "POST" then
user_name = CStr(request.form("Username"))
pass_word = CStr(request.form("Password"))
else
user_name = CStr(request.queryString("Username"))
pass_word = CStr(request.queryString("Password"))
end if


Regards,
Andrew Buntine.