Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Storing Cookies

Reply
Thread Tools

Storing Cookies

 
 
Brian Burgess
Guest
Posts: n/a
 
      09-10-2003
Hi all,

Anyone know of any special issues with storing cookies with ASP? I'm
trying this with two browsers: One is IE 6.0 with cookies set to
'prompt'. This has been working properly as any new site I goto seems
to prompt me to store their cookie. The other is Pocket IE on Pocket
PC 2002, with the cookies set to 'enabled'.

My problem is that the cookies dont seem to be being written with my
ASP. I dont get the prompt to store the cookie when I should. My
storage code looks like this:

Response.Cookies("AcctNbr") = nAcctNbr
Response.Cookies("MsgStart") = nMsgStart
Response.Cookies("MsgEnd") = nMsgEnd
Response.Cookies("AcctNbr").Expires = DateAdd("h", 15, Now)
Response.Cookies("MsgStart").Expires = DateAdd("h", 15, Now)
Response.Cookies("MsgEnd").Expires = DateAdd("h", 15, Now)


And the read code looks like this:

If Not(Request.Cookies("AcctNbr")="") Then
nAcctNbr = CInt(Request.Cookies("AcctNbr"))
End If
If Not(Request.Cookies("MsgStart")="") Then
nMsgStart = CInt(Request.Cookies("MsgStart"))
End If
If Not(Request.Cookies("MsgEnd")="") Then
nMsgEnd = CInt(Request.Cookies("MsgEnd"))
End If


Of course nothing is read in, but past that, my browser does not
prompt for storage either..

Any ideas?

Thanks in advance...

-BB
 
Reply With Quote
 
 
 
 
Mike Moore [MSFT]
Guest
Posts: n/a
 
      09-10-2003
Hi Brian,

You asked if ASP does something special with cookies. No, it sends them to
the browser in the normal manner.

You also wrote that you verified that IE6 is receiving cookies from sites
that you visit, but it appears that pocket IE is not receiving cookies.

When you visit your own web page with IE6 multiple times in a row, does it
receive the values from the cookies? Can you repeat this with Pocket IE? I
think the error is with Pocket IE rather than with the web site.

Thank you, Mike
Microsoft, ASP.NET

Microsoft Security Announcement: Have you installed the patch for Microsoft
Security Bulletin MS03-039? If not, Microsoft strongly advises you to
review the information at the following link regarding Microsoft Security
Bulletin MS03-039
http://www.microsoft.com/technet/sec...n/ms03-039.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the Windows Update scan will help to insure you are current
with all security patches, not just MS03-039.

Microsoft also highly recommends to all customers that you visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computerís security.

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
> From: Brian Burgess <(E-Mail Removed)>
> Subject: Storing Cookies
> Date: Wed, 10 Sep 2003 10:14:59 +0800
> Message-ID: <(E-Mail Removed)>
> X-Newsreader: Forte Free Agent 1.92/32.572
> MIME-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> Newsgroups: microsoft.public.inetserver.asp.general
> NNTP-Posting-Host: vp161007.kln.uac1.hknet.com 203.169.161.7
> Lines: 1
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
> Xref: cpmsftngxa06.phx.gbl microsoft.public.inetserver.asp.general:252150
> X-Tomcat-NG: microsoft.public.inetserver.asp.general
>
> Hi all,
>
> Anyone know of any special issues with storing cookies with ASP? I'm
> trying this with two browsers: One is IE 6.0 with cookies set to
> 'prompt'. This has been working properly as any new site I goto seems
> to prompt me to store their cookie. The other is Pocket IE on Pocket
> PC 2002, with the cookies set to 'enabled'.
>
> My problem is that the cookies dont seem to be being written with my
> ASP. I dont get the prompt to store the cookie when I should. My
> storage code looks like this:
>
> Response.Cookies("AcctNbr") = nAcctNbr
> Response.Cookies("MsgStart") = nMsgStart
> Response.Cookies("MsgEnd") = nMsgEnd
> Response.Cookies("AcctNbr").Expires = DateAdd("h", 15, Now)
> Response.Cookies("MsgStart").Expires = DateAdd("h", 15, Now)
> Response.Cookies("MsgEnd").Expires = DateAdd("h", 15, Now)
>
>
> And the read code looks like this:
>
> If Not(Request.Cookies("AcctNbr")="") Then
> nAcctNbr = CInt(Request.Cookies("AcctNbr"))
> End If
> If Not(Request.Cookies("MsgStart")="") Then
> nMsgStart = CInt(Request.Cookies("MsgStart"))
> End If
> If Not(Request.Cookies("MsgEnd")="") Then
> nMsgEnd = CInt(Request.Cookies("MsgEnd"))
> End If
>
>
> Of course nothing is read in, but past that, my browser does not
> prompt for storage either..
>
> Any ideas?
>
> Thanks in advance...
>
> -BB
>


 
Reply With Quote
 
 
 
 
Brian Burgess
Guest
Posts: n/a
 
      09-11-2003
Well I have my IE60 set to prompt to accept all cookies. And I have
tried a sample cookie setting and reading page from the CodeProject.
This works and prompts me on my IE60 to save the cookie. .. It IS
something I'm doing wrong in my ASP .. just cant figure out what ..


On Wed, 10 Sep 2003 20:38:06 GMT, http://www.velocityreviews.com/forums/(E-Mail Removed) ("Mike
Moore [MSFT]") wrote:

>Hi Brian,
>
>You asked if ASP does something special with cookies. No, it sends them to
>the browser in the normal manner.
>
>You also wrote that you verified that IE6 is receiving cookies from sites
>that you visit, but it appears that pocket IE is not receiving cookies.
>
>When you visit your own web page with IE6 multiple times in a row, does it
>receive the values from the cookies? Can you repeat this with Pocket IE? I
>think the error is with Pocket IE rather than with the web site.
>
>Thank you, Mike
>Microsoft, ASP.NET
>
>Microsoft Security Announcement: Have you installed the patch for Microsoft
>Security Bulletin MS03-039? If not, Microsoft strongly advises you to
>review the information at the following link regarding Microsoft Security
>Bulletin MS03-039
>http://www.microsoft.com/technet/sec...n/ms03-039.asp and/or to
>visit Windows Update at http://windowsupdate.microsoft.com to install the
>patch. Running the Windows Update scan will help to insure you are current
>with all security patches, not just MS03-039.
>
>Microsoft also highly recommends to all customers that you visit the
>http://www.microsoft.com/protect site and perform the three straightforward
>steps listed to improve your computerís security.
>
>This posting is provided "AS IS", with no warranties, and confers no rights.
>
>
>--------------------
>> From: Brian Burgess <(E-Mail Removed)>
>> Subject: Storing Cookies
>> Date: Wed, 10 Sep 2003 10:14:59 +0800
>> Message-ID: <(E-Mail Removed)>
>> X-Newsreader: Forte Free Agent 1.92/32.572
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=us-ascii
>> Content-Transfer-Encoding: 7bit
>> Newsgroups: microsoft.public.inetserver.asp.general
>> NNTP-Posting-Host: vp161007.kln.uac1.hknet.com 203.169.161.7
>> Lines: 1
>> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
>> Xref: cpmsftngxa06.phx.gbl microsoft.public.inetserver.asp.general:252150
>> X-Tomcat-NG: microsoft.public.inetserver.asp.general
>>
>> Hi all,
>>
>> Anyone know of any special issues with storing cookies with ASP? I'm
>> trying this with two browsers: One is IE 6.0 with cookies set to
>> 'prompt'. This has been working properly as any new site I goto seems
>> to prompt me to store their cookie. The other is Pocket IE on Pocket
>> PC 2002, with the cookies set to 'enabled'.
>>
>> My problem is that the cookies dont seem to be being written with my
>> ASP. I dont get the prompt to store the cookie when I should. My
>> storage code looks like this:
>>
>> Response.Cookies("AcctNbr") = nAcctNbr
>> Response.Cookies("MsgStart") = nMsgStart
>> Response.Cookies("MsgEnd") = nMsgEnd
>> Response.Cookies("AcctNbr").Expires = DateAdd("h", 15, Now)
>> Response.Cookies("MsgStart").Expires = DateAdd("h", 15, Now)
>> Response.Cookies("MsgEnd").Expires = DateAdd("h", 15, Now)
>>
>>
>> And the read code looks like this:
>>
>> If Not(Request.Cookies("AcctNbr")="") Then
>> nAcctNbr = CInt(Request.Cookies("AcctNbr"))
>> End If
>> If Not(Request.Cookies("MsgStart")="") Then
>> nMsgStart = CInt(Request.Cookies("MsgStart"))
>> End If
>> If Not(Request.Cookies("MsgEnd")="") Then
>> nMsgEnd = CInt(Request.Cookies("MsgEnd"))
>> End If
>>
>>
>> Of course nothing is read in, but past that, my browser does not
>> prompt for storage either..
>>
>> Any ideas?
>>
>> Thanks in advance...
>>
>> -BB
>>


 
Reply With Quote
 
BrianJian
Guest
Posts: n/a
 
      09-12-2003
What 's the value of nAcctNbr,nMsgStart,nMsgEnd?
This is where the problem exists.

"Brian Burgess" <(E-Mail Removed)>
??????:(E-Mail Removed). ..
> Hi all,
>
> Anyone know of any special issues with storing cookies with ASP? I'm
> trying this with two browsers: One is IE 6.0 with cookies set to
> 'prompt'. This has been working properly as any new site I goto seems
> to prompt me to store their cookie. The other is Pocket IE on Pocket
> PC 2002, with the cookies set to 'enabled'.
>
> My problem is that the cookies dont seem to be being written with my
> ASP. I dont get the prompt to store the cookie when I should. My
> storage code looks like this:
>
> Response.Cookies("AcctNbr") = nAcctNbr
> Response.Cookies("MsgStart") = nMsgStart
> Response.Cookies("MsgEnd") = nMsgEnd
> Response.Cookies("AcctNbr").Expires = DateAdd("h", 15, Now)
> Response.Cookies("MsgStart").Expires = DateAdd("h", 15, Now)
> Response.Cookies("MsgEnd").Expires = DateAdd("h", 15, Now)
>
>
> And the read code looks like this:
>
> If Not(Request.Cookies("AcctNbr")="") Then
> nAcctNbr = CInt(Request.Cookies("AcctNbr"))
> End If
> If Not(Request.Cookies("MsgStart")="") Then
> nMsgStart = CInt(Request.Cookies("MsgStart"))
> End If
> If Not(Request.Cookies("MsgEnd")="") Then
> nMsgEnd = CInt(Request.Cookies("MsgEnd"))
> End If
>
>
> Of course nothing is read in, but past that, my browser does not
> prompt for storage either..
>
> Any ideas?
>
> Thanks in advance...
>
> -BB



 
Reply With Quote
 
Mike Moore [MSFT]
Guest
Posts: n/a
 
      09-12-2003
Hi Brian,

I'd like to return to basics for this. Please start a new blank page and
add this code. Then browse it and then refresh the page with IE and Pocket
IE. Then post the results.
<%
Response.Write Request.Cookies("abc")
Response.Cookies("abc") = "123"
Response.CacheControl="no-cache"
%>

Thank you, Mike
Microsoft, ASP.NET

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computerís security.

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
> From: Brian Burgess <(E-Mail Removed)>
> Subject: Re: Storing Cookies
> Date: Thu, 11 Sep 2003 08:31:49 +0800
> Message-ID: <(E-Mail Removed)>
> References: <(E-Mail Removed)>

<(E-Mail Removed)>
> X-Newsreader: Forte Free Agent 1.92/32.572
> MIME-Version: 1.0
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 8bit
> Newsgroups: microsoft.public.inetserver.asp.general
> NNTP-Posting-Host: vp161007.kln.uac1.hknet.com 203.169.161.7
> Lines: 1
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
> Xref: cpmsftngxa06.phx.gbl microsoft.public.inetserver.asp.general:252315
> X-Tomcat-NG: microsoft.public.inetserver.asp.general
>
> Well I have my IE60 set to prompt to accept all cookies. And I have
> tried a sample cookie setting and reading page from the CodeProject.
> This works and prompts me on my IE60 to save the cookie. .. It IS
> something I'm doing wrong in my ASP .. just cant figure out what ..
>
>
> On Wed, 10 Sep 2003 20:38:06 GMT, (E-Mail Removed) ("Mike
> Moore [MSFT]") wrote:
>
> >Hi Brian,
> >
> >You asked if ASP does something special with cookies. No, it sends them

to
> >the browser in the normal manner.
> >
> >You also wrote that you verified that IE6 is receiving cookies from

sites
> >that you visit, but it appears that pocket IE is not receiving cookies.
> >
> >When you visit your own web page with IE6 multiple times in a row, does

it
> >receive the values from the cookies? Can you repeat this with Pocket IE?

I
> >think the error is with Pocket IE rather than with the web site.
> >
> >Thank you, Mike
> >Microsoft, ASP.NET
> >
> >Microsoft Security Announcement: Have you installed the patch for

Microsoft
> >Security Bulletin MS03-039? If not, Microsoft strongly advises you to
> >review the information at the following link regarding Microsoft

Security
> >Bulletin MS03-039
> >http://www.microsoft.com/technet/sec...n/ms03-039.asp and/or

to
> >visit Windows Update at http://windowsupdate.microsoft.com to install

the
> >patch. Running the Windows Update scan will help to insure you are

current
> >with all security patches, not just MS03-039.
> >
> >Microsoft also highly recommends to all customers that you visit the
> >http://www.microsoft.com/protect site and perform the three

straightforward
> >steps listed to improve your computerís security.
> >
> >This posting is provided "AS IS", with no warranties, and confers no

rights.
> >
> >
> >--------------------
> >> From: Brian Burgess <(E-Mail Removed)>
> >> Subject: Storing Cookies
> >> Date: Wed, 10 Sep 2003 10:14:59 +0800
> >> Message-ID: <(E-Mail Removed)>
> >> X-Newsreader: Forte Free Agent 1.92/32.572
> >> MIME-Version: 1.0
> >> Content-Type: text/plain; charset=us-ascii
> >> Content-Transfer-Encoding: 7bit
> >> Newsgroups: microsoft.public.inetserver.asp.general
> >> NNTP-Posting-Host: vp161007.kln.uac1.hknet.com 203.169.161.7
> >> Lines: 1
> >> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
> >> Xref: cpmsftngxa06.phx.gbl

microsoft.public.inetserver.asp.general:252150
> >> X-Tomcat-NG: microsoft.public.inetserver.asp.general
> >>
> >> Hi all,
> >>
> >> Anyone know of any special issues with storing cookies with ASP? I'm
> >> trying this with two browsers: One is IE 6.0 with cookies set to
> >> 'prompt'. This has been working properly as any new site I goto seems
> >> to prompt me to store their cookie. The other is Pocket IE on Pocket
> >> PC 2002, with the cookies set to 'enabled'.
> >>
> >> My problem is that the cookies dont seem to be being written with my
> >> ASP. I dont get the prompt to store the cookie when I should. My
> >> storage code looks like this:
> >>
> >> Response.Cookies("AcctNbr") = nAcctNbr
> >> Response.Cookies("MsgStart") = nMsgStart
> >> Response.Cookies("MsgEnd") = nMsgEnd
> >> Response.Cookies("AcctNbr").Expires = DateAdd("h", 15, Now)
> >> Response.Cookies("MsgStart").Expires = DateAdd("h", 15, Now)
> >> Response.Cookies("MsgEnd").Expires = DateAdd("h", 15, Now)
> >>
> >>
> >> And the read code looks like this:
> >>
> >> If Not(Request.Cookies("AcctNbr")="") Then
> >> nAcctNbr = CInt(Request.Cookies("AcctNbr"))
> >> End If
> >> If Not(Request.Cookies("MsgStart")="") Then
> >> nMsgStart = CInt(Request.Cookies("MsgStart"))
> >> End If
> >> If Not(Request.Cookies("MsgEnd")="") Then
> >> nMsgEnd = CInt(Request.Cookies("MsgEnd"))
> >> End If
> >>
> >>
> >> Of course nothing is read in, but past that, my browser does not
> >> prompt for storage either..
> >>
> >> Any ideas?
> >>
> >> Thanks in advance...
> >>
> >> -BB
> >>

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give Request.Cookies and Response.Cookies is there any reason to use another method to use cookies? _Who ASP .Net 7 09-18-2008 07:49 PM
User Images: Storing in Files VS Storing in Database Jonathan Wood ASP .Net 1 06-02-2008 05:56 PM
storing pointer vs storing object toton C++ 11 10-13-2006 11:08 AM
Response.Cookies vs Request.Cookies Alex Nitulescu ASP .Net 1 02-03-2005 09:43 AM
storing`passwords in cookies Jason ASP .Net 1 12-29-2003 02:26 PM



Advertisments