Results 1 to 5 of 5

Thread: cookie exists

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    cookie exists

    is there a way to check if cookie exists?

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: cookie exists

    if you need to check if a cookie exists you can just check if it is null as with any request parameter.
    Code:
    if(Request.Cookies["monster"] == null)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Re: cookie exists

    thanks for the code but im using visual basic language so this code doesnt work. i tried this:

    If Request.Cookies("monster") = Null Then

    but that doesnt work either because it says that "null" is not declared.
    Last edited by vincey92; Dec 3rd, 2008 at 05:36 PM.

  4. #4
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: cookie exists

    I've not done vb for a while but I believe that it is nothing in vb.

    eg.
    Code:
    If Request.Cookies("monster") Is Nothing Then

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Re: cookie exists

    it works!!! thanks a lot

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