InstantASP Community Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


Cookie Exception in function... Expand / Collapse
Author
Message
Posted 22/09/2005 23:30:57


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Customers
Last Login: 06/10/2006 05:59:33
Posts: 25, Visits: 122
The code...

value = GetCookie(Key).Value

throws an exception if the cookie does not contain the key. The solution is to check if the cookie exists before fetching this value.  Here is the complete code for the function GetCookieValue() in file "InstantASP.Common\InstantASP.Common\HttpUtility\Cookies.vb"

Public Shared Function GetCookieValue(ByVal Key As String) As String
    Dim c As HttpCookie
    c = GetCookie(Key)
    If Not c Is Nothing Then
        return System.Web.HttpContext.Current.Server.UrlDecode(c.Value)
    End If
End Function



-- Daniel Morin
GenoPro Genealogy Software
http://www.genopro.com/
Post #8601
« Prev Topic | Next Topic »

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ryan Healey, Mark Christianson, Bare, James Trott

Permissions Expand / Collapse

All times are GMT, Time now is 1:11pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 10 queries. Compression Disabled.
Home | Products | Purchase | Support | Company | Contact Us
Privacy Statement | © 1999-2007 InstantASP Limited. All Rights Reserved.