473,289 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

cookie result too long

D.
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
May 12 '06 #1
4 1646
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

May 12 '06 #2
D.
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

May 12 '06 #3
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


May 13 '06 #4
D.
Thanks again

"Göran Andersson" <gu***@guffa.com> wrote in message
news:ud**************@TK2MSFTNGP03.phx.gbl...
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


May 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: N.K | last post by:
Hi , Python's existing cookie module doesnt supports new cookie headers SetCookie2 , How to submit a patch for that ? I tried emailing person who owns that module.But no response. Thanks,...
1
by: Display Name | last post by:
Used one of these canned scripts to set up a JS quiz but not before having used another canned PHP script for "Tell your friend about this Web page!" sort of thing. Now i've gotta integrate them;...
14
by: Alec S. | last post by:
Hi, I'm using JavaScript and Cookies for some customization in a web page. There may be several values in the cookie with names that are not known at runtime. I need a way of deleting them. ...
5
by: Miljana | last post by:
Hi, I have one problem with cookies in ASP.NET application. It seems that I can not retreive cookie from Request.Cookies collection. I put cookie in Response.Cookies collection, and after page...
15
by: Edwin Knoppert | last post by:
I have searched but info is limitted. In my test app i used a non persistant cookie for forms authentication. slidingExpiration is set to true On run and close and rerun the login remains ok....
6
by: jojowebdev | last post by:
Do javascript cookies REALLY have to be this hard? function setCookie( name, value, expires, path, domain, secure ) { var today = new Date(); today.setTime( today.getTime() ); if ( expires ) {...
10
by: eyal.herlin | last post by:
hi, i set a cookie to hold a utf-8 string. either by the server or by the client. it doesn't matter. when i try to read this cookie using Request.Cookies("my_utf8_cookie") on iis 5.0 i get...
7
by: monomaniac21 | last post by:
hi i have a php site which allows users to save a cookie on their computer which stores their user id details and allows them to auto- login. i'm wondering whether this is safe, is it...
1
by: boss007v | last post by:
Hi, Am adding a cookie and clearing it when logout is clicked,but it persists,the codes are // For Cookie Addtion HttpCookie cookie = new HttpCookie("UserId"); cookie.Value =...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.