473,471 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Browser cookies enabled testing

Sri
Hi

I am trying to figure out how to test whether my browser cookies are enabled.
I used the code from the following page
http://msdn.microsoft.com/library/de...tcookies101.as

Basically, it tells me to create a cookie and test the cookie from another page. However, in IE 6.0, if I set my privacy setting to a High level so as to block all cookies, the code always returns that the cookies are enabled.

The code is

Sub Page_Load(
If Not Page.IsPostBack The
If Request.QueryString("AcceptsCookies") Is Nothing The
Response.Cookies("TestCookie").Value = "ok
Response.Cookies("TestCookie").Expires =
DateTime.Now.AddMinutes(1
Response.Redirect("TestForCookies.aspx?redirect=" &
Server.UrlEncode(Request.Url.ToString)
Els
labelAcceptsCookies.Text = "Accept cookies = " &
Request.QueryString("AcceptsCookies"
End I
End I
End Su

In another page: To test the cookies

Sub Page_Load(
Dim redirect As String = Request.QueryString("redirect"
Dim acceptsCookies As Strin
' Was the cookie accepted
If Request.Cookies("TestCookie") Is Nothing The
' No cookie, so it must not have been accepte
acceptsCookies =
Els
acceptsCookies =
' Delete test cooki
Response.Cookies("TestCookie").Expires =
DateTime.Now.AddDays(-1
End I
Response.Redirect(redirect & "?AcceptsCookies=" & acceptsCookies,
True
End Su

IE keeps returning acceptsCookies = 1 all the time. When I test the same using Netscape / Mozilla, I get the expected result. So the code works correctly, however not on IE 6.0. Why

What should I do to enhance the same and give me the correct results? I have set Security to be Highest in Internet, Local Internet, Trusted Sites, Restricted Sites zones and set the Privacy to High to block all cookies.

Any help is appreciated

Thanks

Sri.
Nov 18 '05 #1
0 1251

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

Similar topics

2
by: Tom | last post by:
Hi, I would like to use the standard PHP sessions and I understand they rely on the target web browser to support session cookies. I have tried the following code: <? session_start(); if...
1
by: David M. Gauntt | last post by:
I have been testing some javascript for my professional society web page, and found that I couldn't get Safari to save any cookies. No matter what I assign to document.cookie, I get an empty...
0
by: Sri. | last post by:
Hi I am trying to figure out how to test whether my browser cookies are enabled. I used the code from the following page...
3
by: Ollie | last post by:
Can you check whether a users browser allows you to use cookies? Cheers Ollie
9
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
2
by: Prasad Dannani | last post by:
Hi, I want to know the browser settings like Image Enabled, Cookie Enabled etc., For Cookies and Script Request object has some properties but after disabling certain features also we are...
0
by: dawson | last post by:
I started off by trying to use the HttpCapabilitiesBase.Cookies Property (Note: This property is new in the .NET Framework version 2.0) however it kept on returning true even when I disabled...
24
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I see in javascript if a web browser accepts cookies?...
3
by: =?Utf-8?B?Qkw=?= | last post by:
if (Request.Browser.Cookies) { // Cookies supported } else { // Web browser not supports cookies }
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...
0
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 ...
0
muto222
php
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.