473,320 Members | 1,856 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.

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 1758
"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: 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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.