|
-
Apr 13th, 2005, 10:52 PM
#1
Thread Starter
Fanatic Member
Pulling value from cookie [RESOLVED]
I'm trying to pull a value from some cookies and put them in two variables, one a string and one an integer. Here's my code:
VB Code:
Dim iUserID as Integer
Dim sUserName as String
iUserID = CInt(Val(Request.Cookies("cookieUserID")))
sUserName = CStr(Val(Request.Cookies("cookieUserName")))
But when It loads I get the error:
Argument 'Expression' cannot be converted to type 'HttpCookie'.
I'm new to using cookies so I'm not sure if this is correct way to store their values or not. I can't figure out why its giving me the error.
Thank you!
Last edited by drpcken; Apr 14th, 2005 at 01:10 AM.
-
Apr 14th, 2005, 01:08 AM
#2
Thread Starter
Fanatic Member
Re: Pulling value from cookie
Ahh figured it out myself.
VB Code:
Dim iUserID as Integer
Dim sUserName as String
iUserID = Request.Cookies("cookieUserID").VALUE
sUserName = Request.Cookies("cookieUserName").VALUE
Works like a charm now
-
Apr 14th, 2005, 01:19 AM
#3
Lively Member
Re: Pulling value from cookie [RESOLVED]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|