I link to a web site from an Excel spreadsheet. The page i link to is
getCookie.asp which sets a cookie then returns back some html which opens a
new window, to the same site but a different page (same folder).
The cookie is not received. Can someone explain why?
I worked around this by adding a cache-control header with a value of
no-cache. This fixes the problem. Unfortunately that causes another
problem with Internet Explorer that no-one can figure out (basically with
friendly error messages turned on IE shows an error page for no reason - i
posted a lengthy message about this to m.p.i.asp.gener al but no-one has a
clue).
I have tried every combination of every cache busting header i can think of
but no other one fixes this problem about the cookie not being received.
So basically i'm in a catch-22. If i put the cache-buster in then users
will get a nasty error message from IE unless they have 'friendly' error
messages off. If i leave out cache-buster code then the session cookie
doesn't get returned which means the users cant access my site. Help!
Example asp's are below. To recreate the problem simply create a hyperlink
to getCookie.asp in excel then open it (after each attempt you need to shut
down Excel). By the way everything works fine if you type the URL into IE
directly... the problem is when opening from Excel.
Thanks in advance
Paul
----getCookie.asp------
<%
'cache code which makes next page work
'Response.Cache Control = "no-cache"
'send cookie back to client
Response.Cookie s("PaulSessionI D") = "PaulsCooki e"
%>
<HTML>
<HEAD>
<SCRIPT>
window.open('us eCookie.asp','n ewWin','resizab le,scrollbars,m enubar,toolbar' )
;
</SCRIPT>
</HEAD>
<BODY> </BODY>
</HTML>
------------------------
-----useCookie.asp------
<%Response.Cach eControl = "no-cache"%>
The cookie set by the previous page is:
"<%=Request.Coo kies("PaulSessi onID")%>"
---------------------------
getCookie.asp which sets a cookie then returns back some html which opens a
new window, to the same site but a different page (same folder).
The cookie is not received. Can someone explain why?
I worked around this by adding a cache-control header with a value of
no-cache. This fixes the problem. Unfortunately that causes another
problem with Internet Explorer that no-one can figure out (basically with
friendly error messages turned on IE shows an error page for no reason - i
posted a lengthy message about this to m.p.i.asp.gener al but no-one has a
clue).
I have tried every combination of every cache busting header i can think of
but no other one fixes this problem about the cookie not being received.
So basically i'm in a catch-22. If i put the cache-buster in then users
will get a nasty error message from IE unless they have 'friendly' error
messages off. If i leave out cache-buster code then the session cookie
doesn't get returned which means the users cant access my site. Help!
Example asp's are below. To recreate the problem simply create a hyperlink
to getCookie.asp in excel then open it (after each attempt you need to shut
down Excel). By the way everything works fine if you type the URL into IE
directly... the problem is when opening from Excel.
Thanks in advance
Paul
----getCookie.asp------
<%
'cache code which makes next page work
'Response.Cache Control = "no-cache"
'send cookie back to client
Response.Cookie s("PaulSessionI D") = "PaulsCooki e"
%>
<HTML>
<HEAD>
<SCRIPT>
window.open('us eCookie.asp','n ewWin','resizab le,scrollbars,m enubar,toolbar' )
;
</SCRIPT>
</HEAD>
<BODY> </BODY>
</HTML>
------------------------
-----useCookie.asp------
<%Response.Cach eControl = "no-cache"%>
The cookie set by the previous page is:
"<%=Request.Coo kies("PaulSessi onID")%>"
---------------------------
Comment