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

Why won't cookies work with my javascript under Safari?

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 string when I
read back document.cookie.

In researching this problem, I found a function on the Apple website
to test for cookies. I found that the function sometimes tells me
cookies are enabled and sometimes disabled, as follows:

1) Open the Safari Developers FAQ
(http://developer.apple.com/internet/...afari_faq.html)

2) Push the "Got Cookies?" button. I get the reply "You got cookies",
meaning that cookies are enabled.

3) Save the webpage to my hard disk.

4) Open the file that I just saved on the hard disk.

5) Push the "Got cookies?" button. I now get the reply "No cookies",
meaning that cookies are disabled.

Is there anything weird one must do to a website to get cookies to
work under Safari?

- David Gauntt
Jul 23 '05 #1
1 2766
David M. Gauntt wrote:
1) Open the Safari Developers FAQ
(http://developer.apple.com/internet/...afari_faq.html)

2) Push the "Got Cookies?" button. I get the reply "You got cookies",
meaning that cookies are enabled.

3) Save the webpage to my hard disk.

4) Open the file that I just saved on the hard disk.

5) Push the "Got cookies?" button. I now get the reply "No cookies",
meaning that cookies are disabled.

Is there anything weird one must do to a website to get cookies to
work under Safari?


No. Cookies tend not to work with "file:" URIs in Web browsers,
particularly "file:" URIs do not support a domain part that would
be used to identify the domain of which resources are allowed to
read the cookie.
PointedEars
Jul 23 '05 #2

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

Similar topics

2
by: Michael | last post by:
I am reading and setting a cookie using JavaScript in the BODY onload and onunload events respectively. This works fine. However when I use ASP to set the cookie under some condition where I...
1
by: Sam Wuebben | last post by:
I am using a standard javascript that I downloaded from javascriptsource.com to read from and fill in a form using cookies. The page tests well in every browser except Apple's Safari (from 10.3.2)...
1
by: FayeC | last post by:
I got this snippet online and for the life of me I can't seem to make it write the cookie.... The Flash has the labels mentioned in the code and I used the name=movie and the swconnect=true as...
4
by: 2obvious | last post by:
I'm trying to set a cookie to expire 10 seconds after it is created. However, it seems to last until I close all browser windows. var objDate = new Date(); objDate.setSeconds(...
3
by: Raghu Raman | last post by:
Hi, I want to store a cookie peemanently for 2 days.From msdn article, i have coded like this.It is working when i run my application .But if i close my browser and restart my application , i...
10
by: Stephan Schulz | last post by:
Hi all, I'm fairly new to JavaScript, and couldn't find a way to solve the following problem: I've written an application in DHTML/JavaScript, for one because I want to be able to offer...
13
by: TLaufenberg | last post by:
I'm new to Javascript programming and I've run into a bit of a snag with making an XMLHttpRequest in the Safari browser. Actually, the request doesn't work in Firefox either but only when I use a...
24
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I see in javascript if a web browser accepts cookies?...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.