By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

Storing Cookies

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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 <bb********@hotmail.com>
Subject: Storing Cookies
Date: Wed, 10 Sep 2003 10:14:59 +0800
Message-ID: <bo********************************@4ax.com>
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


Jul 19 '05 #2

P: n/a
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, mi****@online.microsoft.com ("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 <bb********@hotmail.com>
Subject: Storing Cookies
Date: Wed, 10 Sep 2003 10:14:59 +0800
Message-ID: <bo********************************@4ax.com>
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


Jul 19 '05 #3

P: n/a
What 's the value of nAcctNbr,nMsgStart,nMsgEnd?
This is where the problem exists.

"Brian Burgess" <bb********@hotmail.com>
??????:bo********************************@4ax.com. ..
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

Jul 19 '05 #4

P: n/a
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 <bb********@hotmail.com>
Subject: Re: Storing Cookies
Date: Thu, 11 Sep 2003 08:31:49 +0800
Message-ID: <1f********************************@4ax.com>
References: <bo********************************@4ax.com> <dV**************@cpmsftngxa06.phx.gbl> 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, mi****@online.microsoft.com ("Mike
Moore [MSFT]") wrote:
Hi Brian,

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

You also wrote that you verified that IE6 is receiving cookies from sitesthat 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 itreceive the values from the cookies? Can you repeat this with Pocket IE? Ithink 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 MicrosoftSecurity Bulletin MS03-039? If not, Microsoft strongly advises you to
review the information at the following link regarding Microsoft SecurityBulletin MS03-039
http://www.microsoft.com/technet/sec...n/ms03-039.asp and/or tovisit Windows Update at http://windowsupdate.microsoft.com to install thepatch. Running the Windows Update scan will help to insure you are currentwith 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 straightforwardsteps listed to improve your computerís security.

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

--------------------
From: Brian Burgess <bb********@hotmail.com>
Subject: Storing Cookies
Date: Wed, 10 Sep 2003 10:14:59 +0800
Message-ID: <bo********************************@4ax.com>
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



Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.