473,242 Members | 1,458 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,242 software developers and data experts.

Need to test for Cookies

TG
How can I test to ensure a visitors browser allows for cookies? When I
recently setup my browser to not allow cookies and I visited my website my
global and session variables stopped working between pages. Once I set allow
cookies back on, it started working again.

Thanks in advance.
Jul 17 '05 #1
2 1757
"TG" <tg********@cox.net> wrote:
How can I test to ensure a visitors browser allows for cookies? When I
recently setup my browser to not allow cookies and I visited my
website my global and session variables stopped working between pages.
Once I set allow cookies back on, it started working again.


Set a cookie, next page test for it, if it's not set display warning.

HTH;
JOn
Jul 17 '05 #2
"TG" <tg********@cox.net> wrote in message news:<MMCYb.6447$Dc2.1966@lakeread01>...
How can I test to ensure a visitors browser allows for cookies? When I
recently setup my browser to not allow cookies and I visited my website my
global and session variables stopped working between pages. Once I set allow
cookies back on, it started working again.

Thanks in advance.


I'm not sure that there is a straight-forward way to test from a
server-side language like PHP, because PHP has to choose to set the
cookie or not in the HTTP header, before content is sent out. This
kind of check is perhaps better suited to Java Script?

However, the php.ini setting "session.use_trans_sid" may be what you
are looking for - this will maintain your session information between
pages whether or not the browser supports cookies.

See http://uk.php.net/manual/en/ref.sess....use-trans-sid

Louis
Jul 17 '05 #3

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

Similar topics

12
by: George Hester | last post by:
I have always used this in ASP to test if the client is accepting cookies: <%@language="VBScript"%> <% Session ("nc") = 1 If Len(Session("nc")) = 0 Then 'Cookies Off Else 'Cookies On End If
3
by: Stephanie Stowe | last post by:
Hi. I read in some helpful publication "If a cookie created by a page on catalog.acme.com sets its path attribute to "/" and its domain attrinute to "acme.com", that cookie is available to all...
2
by: | last post by:
Its strange...I have experimenting with browser hawk by using the cookie sniffer method. However, even If adjust the security slider level in internet options or goto advanced in the privacy tab I...
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...
1
by: Jon Cosby | last post by:
I'm trying to test browsers for cookies. I have my browser set to prompt me to accept cookies. As it is right now, I'm getting through whether I block the cookie or not (no redirect). I'm deleting...
3
by: Phillip N Rounds | last post by:
I'm having trouble with using cookies to monitor the stages of login. I have a two stage Registration page ( register.aspx ) and my target page ( MyPage.aspx ) I'm using a cookie named LoginStatus...
3
by: Alex | last post by:
Hello. Maybe someone can help me. My development computer has: WindowsXP SP2 and MSSQL Server 2000 and IIS 5.0(or 5.1) Our webserver has: Windows2003 SP1 and MSSQL Server 2005 and IIS 6.0 We are...
3
by: Noremac | last post by:
My google skills must be dwindling. I am trying to determine how in ASP.NET 2.0 I can get the ReturnUrl querystring variable in Forms Authentication to contain the absolute url. Just like others...
19
by: Ganesh J. Acharya | last post by:
Hi there, I want to redesign my website and make that look professional. I made this about 6 years ago with very little knowledge of internet. Today I am getting about 4000 visitors a day for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
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
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...

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.