Wie entfernt man einen SubValue aus einem Cookie?

From: Frank Lehmann (f.leh294_at_world4net.com)
Date: 02/26/04


Date: Thu, 26 Feb 2004 12:13:25 +0100

Hallo NG,

kann mir bitte mal jemand sagen, wie man aus einem Cookie einen SubValue
entfernt, der auf folgende Art erzeugt wurde?:

'**************************************************************************
Dim cookie as HttpCookie = Request.Cookies("meinCookie")

cookie.Values.Add("Merk1", "1")
Cookie.Expires = System.DateTime.Now.AddMonth(6)
Response.AppendCookie(cookie)

cookie.Values.Add("Merk2", "0")
Cookie.Expires = System.DateTime.Now.AddMonth(6)
Response.AppendCookie(cookie)
'**************************************************************************
ergibt
Cookie Name="meinCookie"
Value="Merk1=1&Merk2=0"

Ich möchte Merk1 entfernen, so dass der neue Cookie Value lautet:
Value="Merk2=0"

Vielen Dank im voraus
Frank Lehmann



Relevant Pages

  • Re: how to make cookies into an array?
    ... But you are trying to convert "test1" to a cookie. ... You must specifically create an instance of HttpCookie, fill in its constructor or fields as needed, and then store it. ... Dim allCookies As Generic.Dictionary(Of String, ...
    (microsoft.public.dotnet.languages.vb)
  • Forms Auth keeps going to logon page
    ... I am using forms authentication for a web application I am writing. ... authentication cookie. ... string hash = FormsAuthentication.Encrypt; ... HttpCookie ck = new HttpCookie; ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: XSS - Session hijacking
    ... As for the SessionID cookie, it is generated internally by the default ... HttpCookie cookie = new HttpCookie ... session cookie via some javascript, and the javascript code cannot retrieve ... Subject: XSS - Session hijacking ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • RE: HttpCookie Error.
    ... Dim cookie As HttpCookie ... Source Error: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cookies
    ... > Dim objCookie As HttpCookie ... You need to set an expiration time to the cookie to make it ... If you don't, the cookie will be a session cookie, and it ...
    (microsoft.public.dotnet.framework.aspnet)