As I suspected, you are adding a subkey to the cookie.
If you create a cookie like this:
cookie = New HttpCookie("myookie")
cookie.Values.Add("mycookie", lol)
you get the value using:
cookie.Values["mycookie"]
If you create a cookie like this:
cookie = New HttpCookie("myookie")
cookie.Value = lol
you get the value using:
cookie.Value
D. wrote:
Thanks for replying.
I created it like this:
<%@ Page Language="VB" %>
<script runat="server">
Sub page_load()
Dim cookie As HttpCookie
Dim lol As String
lol = "yes"
cookie = New HttpCookie("myookie")
cookie.Values.Add("mycookie", lol)
Response.Cookies.Add(cookie)
End Sub
</script>
"Göran Andersson" <gu***@guffa.com> wrote in message
news:OP****************@TK2MSFTNGP02.phx.gbl... The Value property only contains the value of the cookie, not the name
of the cookie.
How do you create the cookie? Do you use subkeys?
D. wrote: Hi,
I defined some cookies in order to pass values between pages in my
application.
The problem is that when i request them with:
cookie = Request.Cookies("mycookie")
x = cookie.Value (suppose the value = 'yes')
Response.Write(x)
i get:
'mycookie=yes' instead of just 'yes'.
Any way to avoid the 'mycookie=' or i have to parse the whole string?
Thanks
D