Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Cookies in global.asa

Reply
Thread Tools

Cookies in global.asa

 
 
ou812@ou812.com
Guest
Posts: n/a
 
      06-24-2004
Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
this code in three separate files.

<-- Global.asa -->
sub Session_OnStart
response.cookies("test") = "-1"
end sub
<-- Global.asa -->

<-- testcookie1.asp -->
<%Response.Redirect("testcookie2.asp")%>
<-- testcookie1.asp -->

<-- testcookie2.asp -->
<%=request.cookies("test")%>
<-- testcookie2.asp -->

I get "-1" on testcookie2.asp

Anyone else get the same result?
Why am I getting the cookie in this test?



 
Reply With Quote
 
 
 
 
Aaron [SQL Server MVP]
Guest
Posts: n/a
 
      06-24-2004
Is global.asa on your own machine? Are you sure you set the block in that
zone?

--
http://www.aspfaq.com/
(Reverse address to reply.)




<(E-Mail Removed)> wrote in message
news:(E-Mail Removed).. .
> Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
> this code in three separate files.
>
> <-- Global.asa -->
> sub Session_OnStart
> response.cookies("test") = "-1"
> end sub
> <-- Global.asa -->
>
> <-- testcookie1.asp -->
> <%Response.Redirect("testcookie2.asp")%>
> <-- testcookie1.asp -->
>
> <-- testcookie2.asp -->
> <%=request.cookies("test")%>
> <-- testcookie2.asp -->
>
> I get "-1" on testcookie2.asp
>
> Anyone else get the same result?
> Why am I getting the cookie in this test?
>
>
>



 
Reply With Quote
 
 
 
 
ou812@ou812.com
Guest
Posts: n/a
 
      06-24-2004
On Thu, 24 Jun 2004 16:34:50 -0400, "Aaron [SQL Server MVP]"
<(E-Mail Removed)> wrote:

Nope. The script runs on a commercial host in Canada, not on my
intranet. All I wanted to do was "test" for cookies and I found that
this would just "take" the cookie regardless of the browser settings.


I guess it's taking the cookie because it IS displaying a string
value, although the privacy report (via the icon at the bottom of the
page) states it "blocked" cookies on pages.


>Is global.asa on your own machine? Are you sure you set the block in that
>zone?
>
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>
>
><(E-Mail Removed)> wrote in message
>news:(E-Mail Removed). ..
>> Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
>> this code in three separate files.
>>
>> <-- Global.asa -->
>> sub Session_OnStart
>> response.cookies("test") = "-1"
>> end sub
>> <-- Global.asa -->
>>
>> <-- testcookie1.asp -->
>> <%Response.Redirect("testcookie2.asp")%>
>> <-- testcookie1.asp -->
>>
>> <-- testcookie2.asp -->
>> <%=request.cookies("test")%>
>> <-- testcookie2.asp -->
>>
>> I get "-1" on testcookie2.asp
>>
>> Anyone else get the same result?
>> Why am I getting the cookie in this test?
>>
>>
>>

>
>


 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      06-24-2004
I am not familiar enough with cookies to be sure but you are setting the
cookie with every request.

If all cookies are blocked then session_onstart will fire for every request
(each request will be a new session).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed).. .
> Set IE 6.0 ver. X to "Block all Cookies" in privacy settings and try
> this code in three separate files.
>
> <-- Global.asa -->
> sub Session_OnStart
> response.cookies("test") = "-1"
> end sub
> <-- Global.asa -->
>
> <-- testcookie1.asp -->
> <%Response.Redirect("testcookie2.asp")%>
> <-- testcookie1.asp -->
>
> <-- testcookie2.asp -->
> <%=request.cookies("test")%>
> <-- testcookie2.asp -->
>
> I get "-1" on testcookie2.asp
>
> Anyone else get the same result?
> Why am I getting the cookie in this test?
>
>
>



 
Reply With Quote
 
Zenobia
Guest
Posts: n/a
 
      06-26-2004
On Thu, 24 Jun 2004 20:48:51 GMT, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

>On Thu, 24 Jun 2004 16:34:50 -0400, "Aaron [SQL Server MVP]"
><(E-Mail Removed)> wrote:
>
>Nope. The script runs on a commercial host in Canada, not on my
>intranet. All I wanted to do was "test" for cookies and I found that
>this would just "take" the cookie regardless of the browser settings.
>
>I guess it's taking the cookie because it IS displaying a string
>value, although the privacy report (via the icon at the bottom of the
>page) states it "blocked" cookies on pages.


Maybe the browser just blocks permanent cookies which are stored
on disk after the session's over? ASP session cookies are only
temporary and are destroyed when the session ends. To set a
permanent cookie with ASP give the cookie an expiry date.
Compare how it behaves with both types: permanent and sessional.

A browser that blocked all cookies wouldn't work with ASP.

 
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
What's the proper way of reading cookies? Request.Cookies("mycook") doesnt work user ASP .Net 3 03-31-2007 01:53 PM
Response.Cookies vs Request.Cookies Alex Nitulescu ASP .Net 1 02-03-2005 09:43 AM
Persistent Cookies vs. session cookies Andy Fish Java 3 11-06-2003 10:44 AM
Good Cookies bad Cookies? AK Computer Support 23 10-26-2003 05:20 AM



Advertisments