473,890 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1683
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("myo okie")
cookie.Values.A dd("mycookie", lol)
Response.Cookie s.Add(cookie)
End Sub
</script>
"Göran Andersson" <gu***@guffa.co m> wrote in message
news:OP******** ********@TK2MSF TNGP02.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("myo okie")
cookie.Values.A dd("mycookie", lol)

you get the value using:

cookie.Values["mycookie"]
If you create a cookie like this:

cookie = New HttpCookie("myo okie")
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("myo okie")
cookie.Values.A dd("mycookie", lol)
Response.Cookie s.Add(cookie)
End Sub
</script>
"Göran Andersson" <gu***@guffa.co m> wrote in message
news:OP******** ********@TK2MSF TNGP02.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.co m> wrote in message
news:ud******** ******@TK2MSFTN GP03.phx.gbl...
As I suspected, you are adding a subkey to the cookie.

If you create a cookie like this:

cookie = New HttpCookie("myo okie")
cookie.Values.A dd("mycookie", lol)

you get the value using:

cookie.Values["mycookie"]
If you create a cookie like this:

cookie = New HttpCookie("myo okie")
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("myo okie")
cookie.Values.A dd("mycookie", lol)
Response.Cookie s.Add(cookie)
End Sub
</script>
"Göran Andersson" <gu***@guffa.co m> wrote in message
news:OP******** ********@TK2MSF TNGP02.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
4330
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, Nirmal
1
2472
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; client wants the results from the quiz to go into the email. The file "quizconfig.js" parses the form-submitted test results & the test results page (quiz1_results.htm), in turn, shows the score. The JS in the quizconfig.js appears to set a...
14
3299
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. For example, if my site is www.test.com and the cookie contains: label1 fob
5
5370
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 post back, when I try to retreive it from Request.Cookies collection, it appears that it does not exists. This problem does not occur on several developing machines we use for developing application, but occurs in another environment (another...
15
2157
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. I have a time-out of one minute and indeed, it directs me to the login if i wait to long. The slidingExpiration does it's work also.
6
2607
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 ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name+"="+escape( value ) +
10
2245
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 garbage. this garbage seems to be the result of treating the utf-8 data as some single-byte encoding. i have <%@ codepage="65001"%set on the top of the page. this problem does not appear on iis 5.1.
7
4300
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 possible for a malicious user to find that cookie and change its value and therefore auto-login as someone else? and if so how can this be prevented?
1
1202
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 = objAdminUser.UserID.ToString(); DateTime dtNow = DateTime.Now;
0
9825
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9638
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7171
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6052
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4682
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.