Cookie differences between IE and Netscape
I'm still having problems with using cookies, and there seems to be differences in the way NS 4.5 and IE 5 respond to the same code. I am trying to create a session id which I track using cookies. I am using the following code in the header of each page <!--#if "REQUEST.cookies.has_key('CK_Session')"--> <!--#call "REQUEST.cookies['CK_Session']"--> <!--#else--> <!--#call "RESPONSE.setCookie('CK_Session', ZopeTime().timeTime())"--> <!--#/if--> <!--#call "RESPONSE.setCookie('CK_Last_Visit', ZopeTime().timeTime(), expires=(ZopeTime('GMT') + 365).rfc822())"--> and at the footer of each page, I have the following: sessionID= <!--#if CK_Session--> <!--#var CK_Session--> <!--#else--> Session ID not set <!--#/if--> With NS4.5, when I first log on, I get the message that the Session ID is not set. I refresh the page, and then it appears. Thereafter, each page correctly shows the session ID. With IE5.0, when I access the home page, I get the same message that the Session ID is not set. It appears when I reload the page. However, other pages may not show the footer, or displays a different session ID ( from prior log ons as though it is caching the cookie value from before ). I have added <META HTTP-EQUIV="expires" CONTENT="0"> to the header without any change. ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
In article <$LvGnHA2zBb3EwKL@compkarori.co.nz>, Graham Chiu <anon_emouse@hotmail.com> writes
I have added
<META HTTP-EQUIV="expires" CONTENT="0">
to the header without any change.
Well, I changed my header to this as well <META HTTP-EQUIV="Expires" CONTENT="0"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> and added a random number generator at the bottom of the page Random Number is <!--#var "_.whrandom.uniform(1,1000000)"--> With IE5.0, the random number does not change showing that the pages are being cached by IE5. Is there anything else I can do to stop the caching? ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
Graham Chiu wrote:
and added a random number generator at the bottom of the page
Random Number is <!--#var "_.whrandom.uniform(1,1000000)"-->
With IE5.0, the random number does not change showing that the pages are being cached by IE5.
Is there anything else I can do to stop the caching?
The only reliable way to stop cacheing seems to be changing the url each time ;( I have done it by appending a timestamp as an argument to the referencing url. so that /site.com/personal_welcome becomes /site.com/personal_welcome?T=12432354335 Usually having /cgi-bin/ in the url also has the effect of disabling cacheing. maybe naming your urls to end with .asp can also do the trick for IE :) ------------- Hannu
In article <376CD47D.ADE56055@trust.ee>, Hannu Krosing <hannu@trust.ee> writes
The only reliable way to stop cacheing seems to be changing the url each time ;(
I have done it by appending a timestamp as an argument to the referencing url. so that /site.com/personal_welcome becomes /site.com/personal_welcome?T=12432354335
Hi Hannu, Thanks for the tip. I am using the navigation bar from the zdp site. So, I changed it to <a href="<!--#var link-->?T=<!--#var "_.whrandom.uniform(1,2)"-->"> Which works. IE now behaves like Netscape on my development site. I guess a timestamp is less processor intensive, so I'll try that next.
Usually having /cgi-bin/ in the url also has the effect of disabling cacheing.
I tried that first, and it didn't work. I do find it a little curious that I've never come across this caching problem with IE before. Now, if someone could explain to me what I am doing wrong with the cookie which needs to be refreshed before the value is obtained, I'll be able to finish my site :-) ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
participants (2)
-
Graham Chiu -
Hannu Krosing