Forcing document to submit cookies

D

duane

Dear Experts:

I have a problem.

When you enter the website I am working on, wherever you go within the
website, the URL address on the website will display:
"http:\\..\index.html", whether you go to "Page1.html", "Page2.html",
etc. The cookies in every page is set on "<BODY onLoad =
"setCookie();">. Except for index.html, all the cookies are set and
written to a textfile correctly in the server. All cookie values in
every page in the website are written to a textfile in the server by
using the SAME PHP script.

My question is: Why is the cookie set in index.html not written to a
textfile in the browser? Is it because of the fact that index.html is
considered to never finish loading because it is the page that always
gets displayed on the URL? Is there a way to force the document to
submit cookies in "index.html" to the server without the user knows
anything about it?

The method that I am using right now is by creating an image object,
e.g. img = new image();, and set image.source to be some PHP file that
will process values of cookies submitted. This works correctly for
most pages but all for one page, e.g. index.html.

duane
 
I

Ivo

duane said:
website, the URL address on the website will display:
"http:\\..\index.html", whether you go to "Page1.html", "Page2.html",

I assume you achieve this with a "100%,0%" frame. Unnecessarily complicating
most of the time.
etc. The cookies in every page is set on "<BODY onLoad =
"setCookie();">. Except for index.html, all the cookies are set and
written to a textfile correctly in the server. All cookie values in
every page in the website are written to a textfile in the server by
using the SAME PHP script.

My question is: Why is the cookie set in index.html not written to a
textfile in the browser?

No idea. Perhaps post some example code.

Is it because of the fact that index.html is
considered to never finish loading because it is the page that always
gets displayed on the URL?

Try onload="alert()"

Is there a way to force the document to
submit cookies in "index.html" to the server without the user knows
anything about it?

Cookies are stored on the client side. Forms are submitted to the server.
The method that I am using right now is by creating an image object,
e.g. img = new image();, and set image.source to be some PHP file that
will process values of cookies submitted. This works correctly for
most pages but all for one page, e.g. index.html.

Type
javascript:alert(document.images.length)
in the address bar and verify the number.
If that is correct, and the php image is the last image on the page,
javascript:alert(document.images[document.images.length].src)
or, if it is the first
javascript:alert(document.images[0].src)
That should give you some clues.
HTH
Ivo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top