Results 1 to 3 of 3

Thread: Pulling value from cookie [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member drpcken's Avatar
    Join Date
    Apr 2004
    Location
    devenv
    Posts
    591

    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:
    1. Dim iUserID as Integer
    2. Dim sUserName as String
    3.  
    4. iUserID = CInt(Val(Request.Cookies("cookieUserID")))
    5. 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.

  2. #2

    Thread Starter
    Fanatic Member drpcken's Avatar
    Join Date
    Apr 2004
    Location
    devenv
    Posts
    591

    Talking Re: Pulling value from cookie

    Ahh figured it out myself.

    VB Code:
    1. Dim iUserID as Integer
    2. Dim sUserName as String
    3.  
    4. iUserID = Request.Cookies("cookieUserID").VALUE
    5. sUserName = Request.Cookies("cookieUserName").VALUE

    Works like a charm now

  3. #3
    Lively Member
    Join Date
    May 2004
    Location
    malaysia
    Posts
    89

    Re: Pulling value from cookie [RESOLVED]

    that good

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width