PC Review


Reply
Thread Tools Rate Thread

How to check if cookie not exist?

 
 
Bobby Edward
Guest
Posts: n/a
 
      12th Mar 2008
How do I check to see if a cookie exists or not?

I tried these 3 but they don't work...

If Not Request.Cookies("UserSettings")("IsAdmin") Is Nothing Then...
If Request.Cookies("UserSettings")("IsAdmin") IsNot Nothing Then...
If Not IsNothing(Request.Cookies("UserSettings")("IsAdmin")) Then...

They all give me a System.NullReferenceException.

Thanks!


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      12th Mar 2008
If Not Request.Cookies("UserSettings") Is Nothing Then
If Not Request.Cookies("UserSettings")("IsAdmin") Is Nothing Then
...
end if
end if


-- bruce (sqlwork.com)


"Bobby Edward" wrote:

> How do I check to see if a cookie exists or not?
>
> I tried these 3 but they don't work...
>
> If Not Request.Cookies("UserSettings")("IsAdmin") Is Nothing Then...
> If Request.Cookies("UserSettings")("IsAdmin") IsNot Nothing Then...
> If Not IsNothing(Request.Cookies("UserSettings")("IsAdmin")) Then...
>
> They all give me a System.NullReferenceException.
>
> Thanks!
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for a tab if it is exist Farhad Microsoft Excel Misc 2 21st Dec 2008 07:31 PM
how to check cookie enabled for the browser or not? BL Microsoft ASP .NET 3 8th Sep 2008 06:29 PM
Check browser cookie permission Ayaz Microsoft VB .NET 0 15th Mar 2006 01:01 PM
check SQL db exist... =?Utf-8?B?Sm9u?= Microsoft VB .NET 3 17th May 2005 12:57 PM
IE6 and cookie check Steve Johnson Microsoft ASP .NET 0 16th Jul 2003 08:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:28 AM.