473,320 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Determining if cookies are enabled or not

I know to determine if cookies are enabled or not, you have to try to
create a cookie then try to read it back. I know one method is to redirect
the user to a 2nd page which creates the cookie, then the 2nd page redirects
the user back to the 1st page which tries to read the cookie.

The other method I thought of and am wondering if this is reliable or not,
is to create a cookie when IsPostBack = False, then have the user click a
Submit button which on postback (to the same page) tries to read the cookie.
Is this method as reliable as the first method I mentioned above?

Thanks in advance,
Ben
Nov 18 '05 #1
2 1087
yes, but you won't know cookies are enabled until postback, that why most
sites use a sniffer page (that also checks for required plugins and
javascript support).

-- bruce (sqlwork.com)
"Ben Amada" <be*@REpoMOweVErpick.com> wrote in message
news:OW**************@TK2MSFTNGP11.phx.gbl...
I know to determine if cookies are enabled or not, you have to try to
create a cookie then try to read it back. I know one method is to redirect the user to a 2nd page which creates the cookie, then the 2nd page redirects the user back to the 1st page which tries to read the cookie.

The other method I thought of and am wondering if this is reliable or not,
is to create a cookie when IsPostBack = False, then have the user click a
Submit button which on postback (to the same page) tries to read the cookie. Is this method as reliable as the first method I mentioned above?

Thanks in advance,
Ben

Nov 18 '05 #2
bruce barker wrote:
yes, but you won't know cookies are enabled until postback, that why most
sites use a sniffer page (that also checks for required plugins and
javascript support).

-- bruce (sqlwork.com)
Hi,

A sniffer page would be useful, but in this particular case, I don't mind
waiting until postback to determine if cookies are enabled or not. Thanks
for the information :)

Ben

"Ben Amada" <be*@REpoMOweVErpick.com> wrote in message
news:OW**************@TK2MSFTNGP11.phx.gbl...
I know to determine if cookies are enabled or not, you have to try to
create a cookie then try to read it back. I know one method is to
redirect the user to a 2nd page which creates the cookie, then the 2nd
page redirects the user back to the 1st page which tries to read the
cookie.

The other method I thought of and am wondering if this is reliable or
not, is to create a cookie when IsPostBack = False, then have the user
click a Submit button which on postback (to the same page) tries to read
the cookie. Is this method as reliable as the first method I mentioned
above?

Thanks in advance,
Ben

Nov 18 '05 #3

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

Similar topics

9
by: Agoston Bejo | last post by:
Hi, I searched around everywhere on the net, but could not find a simple example of detecting if cookies are enabled - on server side, and without moving from one page to another. This should be...
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...
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...
6
by: NWx | last post by:
Hi, How can I detect is cookies are enabled or not in client browser? Thanks?
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...
5
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...
1
by: FishKeeper | last post by:
I'm trying to write JavaScript code to test whether cookies are enabled by writing a cookie and then reading its value. My code works fine in Firefox, but it's not working in Internet Explorer 6. ...
24
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I see in javascript if a web browser accepts cookies?...
3
by: damezumari | last post by:
To find out were session variables are stored I included this instruction in my program: echo ini_get("session.save_path"); The reply was /home/7604/data/tmp which is a folder on my server. I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.