Cookies in IE6 - edited

I have a database that I’m web-enabling for anonymous access (read-only.) We have a list of folders in a dropdown in the top frame; the user then clicks a choice which opens in the bottom frame. Works fine.

What I want to do is give the users a “Set default folder” link so that they can automatically open the database to the chosen folder. I’ve set up a link in the $$ViewTemplateDefault that sets a cookie, then set up the bottom frame content formula to check for the cookie. If it exists, set the contents to the folder referenced by the cookie. If there is no cookie, open a specific view.

This works beautifully in Firefox, but doesn’t seem to do anything at all in IE6. Can anyone give me an idea why? Or just tell me how to debug cookie values in IE - I use Firebug in FF, and love it.

I get the feeling this has something to do with IE security settings, but since I don’t use IE, I’m not really sure what the settings need to be to allow this. Unfortunately most of our users do use IE, so this needs to work.

Here’s the code that sets the cookie. The function itself is in the JSHeader of the $$ViewTemplateDefault; it’s called by a link.

expirationDate = new Date

expirationDate.setMonth(expirationDate.getMonth()+12)

function setListCookie(newList)

{

    document.cookie = "defaultListName="+newList+";expires=" + expirationDate.toGMTString()

}

It’s called by an action hotspot set to use JavaScript for the web client:

setListCookie(document.forms[0].viewTitle.value)

The code to retrieve the cookie and set the frame contents:

Cookies:=@GetHTTPHeader(“Cookie”); defaultListName:=@Middle(Cookies;“defaultListName=”;“;”);

cookieValue:=@Right(Cookies; “=”);

@If(Cookies=“”; “webWelcome?Open”; cookieValue+“?Open”)

Subject: Cookies in IE6 - edited

There doesn’t appear to be anything wrong with your code, even from an IE6 persective. Are you having other problems with JS on the page? The reason I ask is that IE6’s JS parse engine is relatively fragile – sometimes the location and order of JS elements can make a difference. Have you tried rendering the cookie (all content) on the page in IE (preferably with both Formula Language AND JS side-by-each) to see if it contains the expected values?

As for a debugger, there’s always Firebug Lite (but it’s called Lite for a reason, obviously).

Subject: RE: Cookies in IE6 - edited

Hi, Stan! Good to hear from you…

No, there are no other JS problems on the page. I did set up a computed text to display the cookie value. Here’s the strange thing. I restarted IE and tried again. Now, it seems like each view I open has a different cookie set with it. Example: I click the dropdown and choose All Products by State, then click the Set Default link. It doesn’t reset immediately; I didn’t want the page to reload. But if I go to the All Products by Discipline folder, it does display the All Products by State in the computed text. However, when I go to All Products by Zone, it displays All Products by Discipline in the computed text, even though I never clicked the Set Default link in the All Products by Discipline folder.

Never heard of Firebug Lite - I’ll look into it.