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

Client Side Cookies IIS, HELP!

OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.freewarejava.com">Freewarejava.com</a></li>
</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided
by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows explorer)
and dclick the .htm file, it opens and it keeps cookie state on the menus
(working)

What do I have to configure in order to make this work when I run the page
from IIS??

Thanks!

-Todd
Nov 17 '05 #1
33 2403
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:


....

Todd,

IIS has nothing to do with cookies.

The difference you may be seeing would be between requesting the page via a
http: url and requesting it via a file: URL (which I believe is what happens
when you just double click in Windows Explorer). In particular, the domain
of the cookie may not match.

There's no way I'm going to read such a large amount of code looking for
this problem. I recommend that you isolate this problem down to just the
cookie issue and see if that helps you. If not, then please post the much
smaller reproducer and I'll be glad to take a look.

Maybe someone else with more patience can see the problem right away?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
Nov 17 '05 #2
Todd,

When I run this code on my machine I get the same result both ways "dclick"
or browse it
I can not go through the entire code but what are the bad simptoms??
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.freewarejava.com">Freewarejava.com</a></li>
</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided
by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style. display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows explorer) and dclick the .htm file, it opens and it keeps cookie state on the menus
(working)

What do I have to configure in order to make this work when I run the page
from IIS??

Thanks!

-Todd

Nov 17 '05 #3
Todd,

When I run this code on my machine I get the same result both ways "dclick"
or browse it
I can not go through the entire code but what are the bad simptoms??
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.freewarejava.com">Freewarejava.com</a></li>
</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided
by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style. display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows explorer) and dclick the .htm file, it opens and it keeps cookie state on the menus
(working)

What do I have to configure in order to make this work when I run the page
from IIS??

Thanks!

-Todd

Nov 17 '05 #4
Dan
if your machine name has an underscore in it that can also
cause problems.

Dan

-----Original Message-----
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"><meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">
<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font- weight:bold ;list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra") ==-1
function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li> <li><a href="http://www.news.bbc.co.uk">BBC News</a></li> </ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li> <li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li> <li><a href="http://www.freewarejava.com">Freewarejava.com</a></li
</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.dynamicdrive.com">outer 1</a></li> <li><a href="http://www.dynamicdrive.com">outer 2</a></li> <li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.dynamicdrive.com">nested 1</a></li> <li><a href="http://www.dynamicdrive.com">nested 2</a></li> </ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li> <li><a href="http://www.dynamicdrive.com">outer 4</a></li> </ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts providedby<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring (offset, end)) }
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++) {if (document.getElementsByTagName("UL") [i].id=="foldinglist"){foldercontentarray[c]=document.getElementsByTagName("UL") [i]c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie (window.location.pathname).split(" ") for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults [i]].previousSibling.previousSibling.style.listStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex - 1].style.listStyleImage="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')|| (ie4&&foldinglist[i].style.display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookiestate for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows explorer)and dclick the .htm file, it opens and it keeps cookie state on the menus(working)

What do I have to configure in order to make this work when I run the pagefrom IIS??

Thanks!

-Todd
.

Nov 17 '05 #5
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu
and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a
menu and refresh the page, the menus keep state, code writes to the
document.cookie.

All I am trying to do is add/implement a static tree navigation menu into an
ASP.NET application I have coded - and I want to keep the navigation state
(which menus the user has expanded, etc) on the client, not the server..

It was not a problem in the asp environment, but seems to be killing me in
asp.net
hehe

I can't figure out why it will not write to the document.cookie when I call
the page via http...
"MS News (MS ILM)" <sq**********@hotmail.com> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Todd,

When I run this code on my machine I get the same result both ways "dclick" or browse it
I can not go through the entire code but what are the bad simptoms??
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0] if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.freewarejava.com">Freewarejava.com</a></li> </ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows

explorer)
and dclick the .htm file, it opens and it keeps cookie state on the menus (working)

What do I have to configure in order to make this work when I run the page from IIS??

Thanks!

-Todd


Nov 17 '05 #6
Dan
if your machine name has an underscore in it that can also
cause problems.

Dan

-----Original Message-----
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"><meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">
<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font- weight:bold ;list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra") ==-1
function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li> <li><a href="http://www.news.bbc.co.uk">BBC News</a></li> </ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li> <li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li> <li><a href="http://www.freewarejava.com">Freewarejava.com</a></li
</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.dynamicdrive.com">outer 1</a></li> <li><a href="http://www.dynamicdrive.com">outer 2</a></li> <li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=& {head};> <li><a href="http://www.dynamicdrive.com">nested 1</a></li> <li><a href="http://www.dynamicdrive.com">nested 2</a></li> </ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li> <li><a href="http://www.dynamicdrive.com">outer 4</a></li> </ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts providedby<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring (offset, end)) }
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++) {if (document.getElementsByTagName("UL") [i].id=="foldinglist"){foldercontentarray[c]=document.getElementsByTagName("UL") [i]c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie (window.location.pathname).split(" ") for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults [i]].previousSibling.previousSibling.style.listStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex - 1].style.listStyleImage="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')|| (ie4&&foldinglist[i].style.display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookiestate for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows explorer)and dclick the .htm file, it opens and it keeps cookie state on the menus(working)

What do I have to configure in order to make this work when I run the pagefrom IIS??

Thanks!

-Todd
.

Nov 17 '05 #7
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu
and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a
menu and refresh the page, the menus keep state, code writes to the
document.cookie.

All I am trying to do is add/implement a static tree navigation menu into an
ASP.NET application I have coded - and I want to keep the navigation state
(which menus the user has expanded, etc) on the client, not the server..

It was not a problem in the asp environment, but seems to be killing me in
asp.net
hehe

I can't figure out why it will not write to the document.cookie when I call
the page via http...
"MS News (MS ILM)" <sq**********@hotmail.com> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Todd,

When I run this code on my machine I get the same result both ways "dclick" or browse it
I can not go through the entire code but what are the bad simptoms??
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0] if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a href="http://www.freewarejava.com">Freewarejava.com</a></li> </ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows

explorer)
and dclick the .htm file, it opens and it keeps cookie state on the menus (working)

What do I have to configure in order to make this work when I run the page from IIS??

Thanks!

-Todd


Nov 17 '05 #8
"Todd" <ts****@smithdata.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a
menu and refresh the page, the menus keep state, code writes to the
document.cookie.


Todd, like I said. Remove the complications of the menu code and concentrate
on the cookie problem. You'll probably find that the problem is the domain
field of the cookie. It needs to be blank for localhost.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #9
"Todd" <ts****@smithdata.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a
menu and refresh the page, the menus keep state, code writes to the
document.cookie.


Todd, like I said. Remove the complications of the menu code and concentrate
on the cookie problem. You'll probably find that the problem is the domain
field of the cookie. It needs to be blank for localhost.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #10
Yeah, I will try to hardcode the domain field path for the cookie and see if
that works. If not I will just scratch everything and keep client state on
an parent IFrame or something..at least I know that works.
hehe

Thanks John

-Todd
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:eU**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu
and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a menu and refresh the page, the menus keep state, code writes to the
document.cookie.


Todd, like I said. Remove the complications of the menu code and

concentrate on the cookie problem. You'll probably find that the problem is the domain
field of the cookie. It needs to be blank for localhost.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #11
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Yeah, I will try to hardcode the domain field path for the cookie and see if that works. If not I will just scratch everything and keep client state on
an parent IFrame or something..at least I know that works.
hehe


Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set it the
right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #12
Yeah, I will try to hardcode the domain field path for the cookie and see if
that works. If not I will just scratch everything and keep client state on
an parent IFrame or something..at least I know that works.
hehe

Thanks John

-Todd
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:eU**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu
and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a menu and refresh the page, the menus keep state, code writes to the
document.cookie.


Todd, like I said. Remove the complications of the menu code and

concentrate on the cookie problem. You'll probably find that the problem is the domain
field of the cookie. It needs to be blank for localhost.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #13
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Yeah, I will try to hardcode the domain field path for the cookie and see if that works. If not I will just scratch everything and keep client state on
an parent IFrame or something..at least I know that works.
hehe


Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set it the
right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #14
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Yeah, I will try to hardcode the domain field path for the cookie and see
if
that works. If not I will just scratch everything and keep client state
on an parent IFrame or something..at least I know that works.
hehe


Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set it

the right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #15
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Yeah, I will try to hardcode the domain field path for the cookie and see
if
that works. If not I will just scratch everything and keep client state
on an parent IFrame or something..at least I know that works.
hehe


Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set it

the right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #16
Todd,

Still works in here
"Todd" <ts****@smithdata.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a
menu and refresh the page, the menus keep state, code writes to the
document.cookie.

All I am trying to do is add/implement a static tree navigation menu into an ASP.NET application I have coded - and I want to keep the navigation state
(which menus the user has expanded, etc) on the client, not the server..

It was not a problem in the asp environment, but seems to be killing me in
asp.net
hehe

I can't figure out why it will not write to the document.cookie when I call the page via http...
"MS News (MS ILM)" <sq**********@hotmail.com> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Todd,

When I run this code on my machine I get the same result both ways

"dclick"
or browse it
I can not go through the entire code but what are the bad simptoms??
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0] if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li> <li><a href="http://www.freewarejava.com">Freewarejava.com</a></li> </ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows

explorer)
and dclick the .htm file, it opens and it keeps cookie state on the menus (working)

What do I have to configure in order to make this work when I run the page from IIS??

Thanks!

-Todd



Nov 17 '05 #17
Todd,

Still works in here
"Todd" <ts****@smithdata.net> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Guys, I don't think its problems with the source code.

When I open the page via http://localhost/Menu.htm each time I expand a menu and refresh the page, the menus always default to all being closed - not
writing to the document.cookie (stateless)

When I open the page via C:\Inetpub\wwwroot\Menu.htm each time I expand a
menu and refresh the page, the menus keep state, code writes to the
document.cookie.

All I am trying to do is add/implement a static tree navigation menu into an ASP.NET application I have coded - and I want to keep the navigation state
(which menus the user has expanded, etc) on the client, not the server..

It was not a problem in the asp environment, but seems to be killing me in
asp.net
hehe

I can't figure out why it will not write to the document.cookie when I call the page via http...
"MS News (MS ILM)" <sq**********@hotmail.com> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Todd,

When I run this code on my machine I get the same result both ways

"dclick"
or browse it
I can not go through the entire code but what are the bad simptoms??
"Todd" <ts****@smithdata.net> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten 03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0] if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
<li><a href="http://www.javascriptkit.com">JavaScript Kit</a></li> <li><a href="http://www.freewarejava.com">Freewarejava.com</a></li> </ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">outer 1</a></li>
<li><a href="http://www.dynamicdrive.com">outer 2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&{head};>
<li><a href="http://www.dynamicdrive.com">nested 1</a></li>
<li><a href="http://www.dynamicdrive.com">nested 2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer 3</a></li>
<li><a href="http://www.dynamicdrive.com">outer 4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will not keep cookie state for the menu selection (not-working).

When I open the webroot folder directly from the C drive (windows

explorer)
and dclick the .htm file, it opens and it keeps cookie state on the menus (working)

What do I have to configure in order to make this work when I run the page from IIS??

Thanks!

-Todd



Nov 17 '05 #18
Dan,

You totally ROCK

"Dan" <da*@nospam.com> wrote in message
news:0b****************************@phx.gbl...
if your machine name has an underscore in it that can also
cause problems.

Dan

-----Original Message-----
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0

Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual

Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual

Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-

weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten

03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")

==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling :

cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC

News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC

News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic

Drive</a></li>
<li><a

href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a

href="http://www.freewarejava.com">Freewarejava.com</a></li

</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.dynamicdrive.com">outer

1</a></li>
<li><a href="http://www.dynamicdrive.com">outer

2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.dynamicdrive.com">nested

1</a></li>
<li><a href="http://www.dynamicdrive.com">nested

2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer

3</a></li>
<li><a href="http://www.dynamicdrive.com">outer

4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML

scripts provided
by<br>
<a href="http://www.dynamicdrive.com">Dynamic

Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring

(offset, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++)

{
if (document.getElementsByTagName("UL")

[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")

[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie

(window.location.pathname).split(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults

[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -

1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||

(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will

not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive

(windows explorer)
and dclick the .htm file, it opens and it keeps cookie

state on the menus
(working)

What do I have to configure in order to make this work

when I run the page
from IIS??

Thanks!

-Todd
.

Nov 17 '05 #19
Dan,

You totally ROCK

"Dan" <da*@nospam.com> wrote in message
news:0b****************************@phx.gbl...
if your machine name has an underscore in it that can also
cause problems.

Dan

-----Original Message-----
OK,

I created a .htm page within a new Web solution:
--------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0

Transitional//EN">
<html>
<head>
<title>Menu</title>
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual

Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual

Studio .NET 7.1">

<style>
<!--
#foldheader{cursor:pointer;cursor:hand ; font-

weight:bold ;
list-style-image:url(fold.gif)}
#foldinglist{list-style-image:url(list.gif)}
//-->
</style>
<script language="JavaScript1.2">
<!--

//Smart Folding Menu tree- By Dynamic Drive (rewritten

03/03/02)
//For full source code and more DHTML scripts, visit
http://www.dynamicdrive.com
//This credit MUST stay intact for use

var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")

==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling :

cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

//-->
</script>

</head>
<body MS_POSITIONING="GridLayout">
<font face="Verdana">

<ul>
<li id="foldheader">News</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.cnn.com">CNN</a></li>
<li><a href="http://www.abcnews.com">ABC

News</a></li>
<li><a href="http://www.news.bbc.co.uk">BBC

News</a></li>
</ul>

<li id="foldheader">Webmaster</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.dynamicdrive.com">Dynamic

Drive</a></li>
<li><a

href="http://www.javascriptkit.com">JavaScript Kit</a></li>
<li><a

href="http://www.freewarejava.com">Freewarejava.com</a></li

</ul>

<li id="foldheader">Nested Example</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.dynamicdrive.com">outer

1</a></li>
<li><a href="http://www.dynamicdrive.com">outer

2</a></li>
<li id="foldheader">Nested</li>
<ul id="foldinglist" style="display:none" style=&

{head};>
<li><a href="http://www.dynamicdrive.com">nested

1</a></li>
<li><a href="http://www.dynamicdrive.com">nested

2</a></li>
</ul>
<li><a href="http://www.dynamicdrive.com">outer

3</a></li>
<li><a href="http://www.dynamicdrive.com">outer

4</a></li>
</ul>
</ul>

</font>

<p align="center"><font face="Arial" size="-2">Free DHTML

scripts provided
by<br>
<a href="http://www.dynamicdrive.com">Dynamic

Drive</a></font></p>

<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring

(offset, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++)

{
if (document.getElementsByTagName("UL")

[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")

[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie

(window.location.pathname).split(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults

[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -

1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||

(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>

</body>
</html>
--------------------------------------------------------

When I compile it, or run it straight from IIS, it will

not keep cookie
state for the menu selection (not-working).

When I open the webroot folder directly from the C drive

(windows explorer)
and dclick the .htm file, it opens and it keeps cookie

state on the menus
(working)

What do I have to configure in order to make this work

when I run the page
from IIS??

Thanks!

-Todd
.

Nov 17 '05 #20
Todd,

I meant the _cookie_ domain.

Please post the code you use to create the cookie.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Yeah, I will try to hardcode the domain field path for the cookie and see
if
that works. If not I will just scratch everything and keep client
state on an parent IFrame or something..at least I know that works.
hehe


Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set it

the
right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com


Nov 17 '05 #21
Todd,

I meant the _cookie_ domain.

Please post the code you use to create the cookie.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Yeah, I will try to hardcode the domain field path for the cookie and see
if
that works. If not I will just scratch everything and keep client
state on an parent IFrame or something..at least I know that works.
hehe


Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set it

the
right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com


Nov 17 '05 #22
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Todd,

I meant the _cookie_ domain.

Please post the code you use to create the cookie.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
> Yeah, I will try to hardcode the domain field path for the cookie
and see
if
> that works. If not I will just scratch everything and keep client state
on
> an parent IFrame or something..at least I know that works.
> hehe

Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set

it the
right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com



Nov 17 '05 #23
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Todd,

I meant the _cookie_ domain.

Please post the code you use to create the cookie.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
"Todd" <ts****@smithdata.net> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
> Yeah, I will try to hardcode the domain field path for the cookie
and see
if
> that works. If not I will just scratch everything and keep client state
on
> an parent IFrame or something..at least I know that works.
> hehe

Todd, that's not what I said.

I said, try to find out what the domain is set to, then learn to set

it the
right way.

How are you setting it now?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com



Nov 17 '05 #24
Todd, what is window.location.pathname in the case where it works and the
case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style. display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Todd,

I meant the _cookie_ domain.

Please post the code you use to create the cookie.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
> "Todd" <ts****@smithdata.net> wrote in message
> news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > Yeah, I will try to hardcode the domain field path for the cookie and see
> if
> > that works. If not I will just scratch everything and keep client

state
on
> > an parent IFrame or something..at least I know that works.
> > hehe
>
> Todd, that's not what I said.
>
> I said, try to find out what the domain is set to, then learn to set it the
> right way.
>
> How are you setting it now?
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
>



Nov 17 '05 #25
Todd, what is window.location.pathname in the case where it works and the
case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style. display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
Todd,

I meant the _cookie_ domain.

Please post the code you use to create the cookie.

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
The domain is set to my machine name (todd_sloan).

How do I change it?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
> "Todd" <ts****@smithdata.net> wrote in message
> news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > Yeah, I will try to hardcode the domain field path for the cookie and see
> if
> > that works. If not I will just scratch everything and keep client

state
on
> > an parent IFrame or something..at least I know that works.
> > hehe
>
> Todd, that's not what I said.
>
> I said, try to find out what the domain is set to, then learn to set it the
> right way.
>
> How are you setting it now?
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
>



Nov 17 '05 #26
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the
Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into
the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
Todd, what is window.location.pathname in the case where it works and the
case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
> Todd,
>
> I meant the _cookie_ domain.
>
> Please post the code you use to create the cookie.
>
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
> "Todd" <ts****@smithdata.net> wrote in message
> news:%2****************@TK2MSFTNGP12.phx.gbl...
> > The domain is set to my machine name (todd_sloan).
> >
> > How do I change it?
> >
> >
> > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > "Todd" <ts****@smithdata.net> wrote in message
> > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > Yeah, I will try to hardcode the domain field path for the cookie and
> > see
> > > if
> > > > that works. If not I will just scratch everything and keep client > state
> > on
> > > > an parent IFrame or something..at least I know that works.
> > > > hehe
> > >
> > > Todd, that's not what I said.
> > >
> > > I said, try to find out what the domain is set to, then learn to set it
> > the
> > > right way.
> > >
> > > How are you setting it now?
> > > --
> > > John Saunders
> > > Internet Engineer
> > > jo***********@surfcontrol.com
> > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #27
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the
Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into
the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
Todd, what is window.location.pathname in the case where it works and the
case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
<script language="JavaScript1.2">
<!--

function get_cookie(Name) {
//Get cookie routine by Shelley Powers
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(off set, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (ns6){
for (i=0;i<document.getElementsByTagName("UL").length; i++){
if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
foldercontentarray[c]=document.getElementsByTagName("UL")[i]
c++
}
}
}

if (get_cookie(window.location.pathname) != ''){
var openresults=get_cookie(window.location.pathname).s plit(" ")
for (i=0 ; i < openresults.length ; i++){
if (ns6){
foldercontentarray[openresults[i]].style.display=''

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
tStyleImage="url(open.gif)"
}
else{
foldinglist[openresults[i]].style.display=''


document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
e="url(open.gif)"
}
}
}

if (ns6||ie4){
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit(){
for (i=0 ; i <= nodelength ; i++){
if

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
document.cookie=window.location.pathname+"="+openo nes
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
> Todd,
>
> I meant the _cookie_ domain.
>
> Please post the code you use to create the cookie.
>
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
> "Todd" <ts****@smithdata.net> wrote in message
> news:%2****************@TK2MSFTNGP12.phx.gbl...
> > The domain is set to my machine name (todd_sloan).
> >
> > How do I change it?
> >
> >
> > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > "Todd" <ts****@smithdata.net> wrote in message
> > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > Yeah, I will try to hardcode the domain field path for the cookie and
> > see
> > > if
> > > > that works. If not I will just scratch everything and keep client > state
> > on
> > > > an parent IFrame or something..at least I know that works.
> > > > hehe
> > >
> > > Todd, that's not what I said.
> > >
> > > I said, try to find out what the domain is set to, then learn to set it
> > the
> > > right way.
> > >
> > > How are you setting it now?
> > > --
> > > John Saunders
> > > Internet Engineer
> > > jo***********@surfcontrol.com
> > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #28
Got it working!

Yeah I have like 10-15 different aspx pages all sharing the same .htm menu
() and what it was doing was creating a cookie for the menu state on each
aspx. page...hehe

So I forced the cookie to be created in one page, in the IFrame's parent,
and then hardcoded the window.location.pathname
("/ClerkOfCourt/CourtIndexing/MainNavigator.aspx")

<script language="JavaScript">
<!--
function get_cookie(Name)
{
var search = Name + "="
var returnvalue = "";
if (parent.document.cookie.length > 0)
{
offset = parent.document.cookie.indexOf(search)
// if cookie exists
if (offset != -1)
{
offset += search.length
// set index of beginning of value
end = parent.document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = parent.document.cookie.length;
returnvalue=unescape(parent.document.cookie.substr ing(offset, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (get_cookie("/ClerkOfCourt/CourtIndexing/MainNavigator.aspx") != '')
{
var
openresults=get_cookie("/ClerkOfCourt/CourtIndexing/MainNavigator.aspx").spl
it(" ")
for (i=0 ; i < openresults.length ; i++)
{
if (ns6)
{
foldercontentarray[openresults[i]].style.display=''
}
else
{
foldinglist[openresults[i]].style.display=''
}
}
}

if (ns6||ie4)
{
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit()
{
for (i=0 ; i <= nodelength ; i++)
{
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
//parent.document.cookie=window.location.pathname+"= "+openones

parent.document.cookie="/ClerkOfCourt/CourtIndexing/MainNavigator.aspx="+ope
nones
alert(parent.document.cookie)
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
Working like a champ now.

Thanks for all the help John. You pointed me in the right direction. Voice
of reason..
hehe

-T

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the
Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
Todd, what is window.location.pathname in the case where it works and the case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
> <script language="JavaScript1.2">
> <!--
>
> function get_cookie(Name) {
> //Get cookie routine by Shelley Powers
> var search = Name + "="
> var returnvalue = "";
> if (document.cookie.length > 0) {
> offset = document.cookie.indexOf(search)
> // if cookie exists
> if (offset != -1) {
> offset += search.length
> // set index of beginning of value
> end = document.cookie.indexOf(";", offset);
> // set index of end of cookie value
> if (end == -1) end = document.cookie.length;
> returnvalue=unescape(document.cookie.substring(off set, end))
> }
> }
> return returnvalue;
> }
>
> var foldercontentarray=new Array()
> var c=0
>
> if (ns6){
> for (i=0;i<document.getElementsByTagName("UL").length; i++){
> if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
> foldercontentarray[c]=document.getElementsByTagName("UL")[i]
> c++
> }
> }
> }
>
> if (get_cookie(window.location.pathname) != ''){
> var openresults=get_cookie(window.location.pathname).s plit(" ")
> for (i=0 ; i < openresults.length ; i++){
> if (ns6){
> foldercontentarray[openresults[i]].style.display=''
>
>

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
> tStyleImage="url(open.gif)"
> }
> else{
> foldinglist[openresults[i]].style.display=''
>
>
>
>
>

document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
> e="url(open.gif)"
> }
> }
> }
>
> if (ns6||ie4){
> var nodelength=ns6? c-1 : foldinglist.length-1
> var nodes=new Array(nodelength)
> var openones=''
> }
>
> function checkit(){
> for (i=0 ; i <= nodelength ; i++){
> if
>

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
> display==''))
> openones=openones + " " + i
> }
> document.cookie=window.location.pathname+"="+openo nes
> }
>
> if (ns6||ie4)
> window.onunload=checkit
> //-->
> </script>
>
>
> "John Saunders" <jo***********@surfcontrol.com> wrote in message
> news:u%****************@TK2MSFTNGP09.phx.gbl...
> > Todd,
> >
> > I meant the _cookie_ domain.
> >
> > Please post the code you use to create the cookie.
> >
> > --
> > John Saunders
> > Internet Engineer
> > jo***********@surfcontrol.com
> >
> >
> > "Todd" <ts****@smithdata.net> wrote in message
> > news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > The domain is set to my machine name (todd_sloan).
> > >
> > > How do I change it?
> > >
> > >
> > > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > > "Todd" <ts****@smithdata.net> wrote in message
> > > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > > Yeah, I will try to hardcode the domain field path for the

cookie
> and
> > > see
> > > > if
> > > > > that works. If not I will just scratch everything and keep

client
> > state
> > > on
> > > > > an parent IFrame or something..at least I know that works.
> > > > > hehe
> > > >
> > > > Todd, that's not what I said.
> > > >
> > > > I said, try to find out what the domain is set to, then learn

to set
> it
> > > the
> > > > right way.
> > > >
> > > > How are you setting it now?
> > > > --
> > > > John Saunders
> > > > Internet Engineer
> > > > jo***********@surfcontrol.com
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #29
Got it working!

Yeah I have like 10-15 different aspx pages all sharing the same .htm menu
() and what it was doing was creating a cookie for the menu state on each
aspx. page...hehe

So I forced the cookie to be created in one page, in the IFrame's parent,
and then hardcoded the window.location.pathname
("/ClerkOfCourt/CourtIndexing/MainNavigator.aspx")

<script language="JavaScript">
<!--
function get_cookie(Name)
{
var search = Name + "="
var returnvalue = "";
if (parent.document.cookie.length > 0)
{
offset = parent.document.cookie.indexOf(search)
// if cookie exists
if (offset != -1)
{
offset += search.length
// set index of beginning of value
end = parent.document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = parent.document.cookie.length;
returnvalue=unescape(parent.document.cookie.substr ing(offset, end))
}
}
return returnvalue;
}

var foldercontentarray=new Array()
var c=0

if (get_cookie("/ClerkOfCourt/CourtIndexing/MainNavigator.aspx") != '')
{
var
openresults=get_cookie("/ClerkOfCourt/CourtIndexing/MainNavigator.aspx").spl
it(" ")
for (i=0 ; i < openresults.length ; i++)
{
if (ns6)
{
foldercontentarray[openresults[i]].style.display=''
}
else
{
foldinglist[openresults[i]].style.display=''
}
}
}

if (ns6||ie4)
{
var nodelength=ns6? c-1 : foldinglist.length-1
var nodes=new Array(nodelength)
var openones=''
}

function checkit()
{
for (i=0 ; i <= nodelength ; i++)
{
if
((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
display==''))
openones=openones + " " + i
}
//parent.document.cookie=window.location.pathname+"= "+openones

parent.document.cookie="/ClerkOfCourt/CourtIndexing/MainNavigator.aspx="+ope
nones
alert(parent.document.cookie)
}

if (ns6||ie4)
window.onunload=checkit
//-->
</script>
Working like a champ now.

Thanks for all the help John. You pointed me in the right direction. Voice
of reason..
hehe

-T

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the
Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
Todd, what is window.location.pathname in the case where it works and the case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
> <script language="JavaScript1.2">
> <!--
>
> function get_cookie(Name) {
> //Get cookie routine by Shelley Powers
> var search = Name + "="
> var returnvalue = "";
> if (document.cookie.length > 0) {
> offset = document.cookie.indexOf(search)
> // if cookie exists
> if (offset != -1) {
> offset += search.length
> // set index of beginning of value
> end = document.cookie.indexOf(";", offset);
> // set index of end of cookie value
> if (end == -1) end = document.cookie.length;
> returnvalue=unescape(document.cookie.substring(off set, end))
> }
> }
> return returnvalue;
> }
>
> var foldercontentarray=new Array()
> var c=0
>
> if (ns6){
> for (i=0;i<document.getElementsByTagName("UL").length; i++){
> if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
> foldercontentarray[c]=document.getElementsByTagName("UL")[i]
> c++
> }
> }
> }
>
> if (get_cookie(window.location.pathname) != ''){
> var openresults=get_cookie(window.location.pathname).s plit(" ")
> for (i=0 ; i < openresults.length ; i++){
> if (ns6){
> foldercontentarray[openresults[i]].style.display=''
>
>

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
> tStyleImage="url(open.gif)"
> }
> else{
> foldinglist[openresults[i]].style.display=''
>
>
>
>
>

document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
> e="url(open.gif)"
> }
> }
> }
>
> if (ns6||ie4){
> var nodelength=ns6? c-1 : foldinglist.length-1
> var nodes=new Array(nodelength)
> var openones=''
> }
>
> function checkit(){
> for (i=0 ; i <= nodelength ; i++){
> if
>

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
> display==''))
> openones=openones + " " + i
> }
> document.cookie=window.location.pathname+"="+openo nes
> }
>
> if (ns6||ie4)
> window.onunload=checkit
> //-->
> </script>
>
>
> "John Saunders" <jo***********@surfcontrol.com> wrote in message
> news:u%****************@TK2MSFTNGP09.phx.gbl...
> > Todd,
> >
> > I meant the _cookie_ domain.
> >
> > Please post the code you use to create the cookie.
> >
> > --
> > John Saunders
> > Internet Engineer
> > jo***********@surfcontrol.com
> >
> >
> > "Todd" <ts****@smithdata.net> wrote in message
> > news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > The domain is set to my machine name (todd_sloan).
> > >
> > > How do I change it?
> > >
> > >
> > > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > > "Todd" <ts****@smithdata.net> wrote in message
> > > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > > Yeah, I will try to hardcode the domain field path for the

cookie
> and
> > > see
> > > > if
> > > > > that works. If not I will just scratch everything and keep

client
> > state
> > > on
> > > > > an parent IFrame or something..at least I know that works.
> > > > > hehe
> > > >
> > > > Todd, that's not what I said.
> > > >
> > > > I said, try to find out what the domain is set to, then learn

to set
> it
> > > the
> > > > right way.
> > > >
> > > > How are you setting it now?
> > > > --
> > > > John Saunders
> > > > Internet Engineer
> > > > jo***********@surfcontrol.com
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #30
Good job John.

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the
Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
Todd, what is window.location.pathname in the case where it works and the case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
> <script language="JavaScript1.2">
> <!--
>
> function get_cookie(Name) {
> //Get cookie routine by Shelley Powers
> var search = Name + "="
> var returnvalue = "";
> if (document.cookie.length > 0) {
> offset = document.cookie.indexOf(search)
> // if cookie exists
> if (offset != -1) {
> offset += search.length
> // set index of beginning of value
> end = document.cookie.indexOf(";", offset);
> // set index of end of cookie value
> if (end == -1) end = document.cookie.length;
> returnvalue=unescape(document.cookie.substring(off set, end))
> }
> }
> return returnvalue;
> }
>
> var foldercontentarray=new Array()
> var c=0
>
> if (ns6){
> for (i=0;i<document.getElementsByTagName("UL").length; i++){
> if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
> foldercontentarray[c]=document.getElementsByTagName("UL")[i]
> c++
> }
> }
> }
>
> if (get_cookie(window.location.pathname) != ''){
> var openresults=get_cookie(window.location.pathname).s plit(" ")
> for (i=0 ; i < openresults.length ; i++){
> if (ns6){
> foldercontentarray[openresults[i]].style.display=''
>
>

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
> tStyleImage="url(open.gif)"
> }
> else{
> foldinglist[openresults[i]].style.display=''
>
>
>
>
>

document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
> e="url(open.gif)"
> }
> }
> }
>
> if (ns6||ie4){
> var nodelength=ns6? c-1 : foldinglist.length-1
> var nodes=new Array(nodelength)
> var openones=''
> }
>
> function checkit(){
> for (i=0 ; i <= nodelength ; i++){
> if
>

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
> display==''))
> openones=openones + " " + i
> }
> document.cookie=window.location.pathname+"="+openo nes
> }
>
> if (ns6||ie4)
> window.onunload=checkit
> //-->
> </script>
>
>
> "John Saunders" <jo***********@surfcontrol.com> wrote in message
> news:u%****************@TK2MSFTNGP09.phx.gbl...
> > Todd,
> >
> > I meant the _cookie_ domain.
> >
> > Please post the code you use to create the cookie.
> >
> > --
> > John Saunders
> > Internet Engineer
> > jo***********@surfcontrol.com
> >
> >
> > "Todd" <ts****@smithdata.net> wrote in message
> > news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > The domain is set to my machine name (todd_sloan).
> > >
> > > How do I change it?
> > >
> > >
> > > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > > "Todd" <ts****@smithdata.net> wrote in message
> > > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > > Yeah, I will try to hardcode the domain field path for the

cookie
> and
> > > see
> > > > if
> > > > > that works. If not I will just scratch everything and keep

client
> > state
> > > on
> > > > > an parent IFrame or something..at least I know that works.
> > > > > hehe
> > > >
> > > > Todd, that's not what I said.
> > > >
> > > > I said, try to find out what the domain is set to, then learn

to set
> it
> > > the
> > > > right way.
> > > >
> > > > How are you setting it now?
> > > > --
> > > > John Saunders
> > > > Internet Engineer
> > > > jo***********@surfcontrol.com
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #31
Good job John.

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the
Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
Todd, what is window.location.pathname in the case where it works and the case where it does not work?
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
> <script language="JavaScript1.2">
> <!--
>
> function get_cookie(Name) {
> //Get cookie routine by Shelley Powers
> var search = Name + "="
> var returnvalue = "";
> if (document.cookie.length > 0) {
> offset = document.cookie.indexOf(search)
> // if cookie exists
> if (offset != -1) {
> offset += search.length
> // set index of beginning of value
> end = document.cookie.indexOf(";", offset);
> // set index of end of cookie value
> if (end == -1) end = document.cookie.length;
> returnvalue=unescape(document.cookie.substring(off set, end))
> }
> }
> return returnvalue;
> }
>
> var foldercontentarray=new Array()
> var c=0
>
> if (ns6){
> for (i=0;i<document.getElementsByTagName("UL").length; i++){
> if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
> foldercontentarray[c]=document.getElementsByTagName("UL")[i]
> c++
> }
> }
> }
>
> if (get_cookie(window.location.pathname) != ''){
> var openresults=get_cookie(window.location.pathname).s plit(" ")
> for (i=0 ; i < openresults.length ; i++){
> if (ns6){
> foldercontentarray[openresults[i]].style.display=''
>
>

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis
> tStyleImage="url(open.gif)"
> }
> else{
> foldinglist[openresults[i]].style.display=''
>
>
>
>
>

document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
> e="url(open.gif)"
> }
> }
> }
>
> if (ns6||ie4){
> var nodelength=ns6? c-1 : foldinglist.length-1
> var nodes=new Array(nodelength)
> var openones=''
> }
>
> function checkit(){
> for (i=0 ; i <= nodelength ; i++){
> if
>

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
> display==''))
> openones=openones + " " + i
> }
> document.cookie=window.location.pathname+"="+openo nes
> }
>
> if (ns6||ie4)
> window.onunload=checkit
> //-->
> </script>
>
>
> "John Saunders" <jo***********@surfcontrol.com> wrote in message
> news:u%****************@TK2MSFTNGP09.phx.gbl...
> > Todd,
> >
> > I meant the _cookie_ domain.
> >
> > Please post the code you use to create the cookie.
> >
> > --
> > John Saunders
> > Internet Engineer
> > jo***********@surfcontrol.com
> >
> >
> > "Todd" <ts****@smithdata.net> wrote in message
> > news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > The domain is set to my machine name (todd_sloan).
> > >
> > > How do I change it?
> > >
> > >
> > > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > > "Todd" <ts****@smithdata.net> wrote in message
> > > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > > Yeah, I will try to hardcode the domain field path for the

cookie
> and
> > > see
> > > > if
> > > > > that works. If not I will just scratch everything and keep

client
> > state
> > > on
> > > > > an parent IFrame or something..at least I know that works.
> > > > > hehe
> > > >
> > > > Todd, that's not what I said.
> > > >
> > > > I said, try to find out what the domain is set to, then learn

to set
> it
> > > the
> > > > right way.
> > > >
> > > > How are you setting it now?
> > > > --
> > > > John Saunders
> > > > Internet Engineer
> > > > jo***********@surfcontrol.com
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #32
Yeah, I guess if you spend enough time debugging your own cookie errors, you
can sometimes help some else with theirs. :-)

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"MS News (MS ILM)" <sq**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Good job John.

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
> Todd, what is window.location.pathname in the case where it works and
the
> case where it does not work?
>
>
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
>
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
> "Todd" <ts****@smithdata.net> wrote in message
> news:uI**************@TK2MSFTNGP12.phx.gbl...
> > <script language="JavaScript1.2">
> > <!--
> >
> > function get_cookie(Name) {
> > //Get cookie routine by Shelley Powers
> > var search = Name + "="
> > var returnvalue = "";
> > if (document.cookie.length > 0) {
> > offset = document.cookie.indexOf(search)
> > // if cookie exists
> > if (offset != -1) {
> > offset += search.length
> > // set index of beginning of value
> > end = document.cookie.indexOf(";", offset);
> > // set index of end of cookie value
> > if (end == -1) end = document.cookie.length;
> > returnvalue=unescape(document.cookie.substring(off set, end))
> > }
> > }
> > return returnvalue;
> > }
> >
> > var foldercontentarray=new Array()
> > var c=0
> >
> > if (ns6){
> > for (i=0;i<document.getElementsByTagName("UL").length; i++){
> > if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
> > foldercontentarray[c]=document.getElementsByTagName("UL")[i]
> > c++
> > }
> > }
> > }
> >
> > if (get_cookie(window.location.pathname) != ''){
> > var openresults=get_cookie(window.location.pathname).s plit(" ")
> > for (i=0 ; i < openresults.length ; i++){
> > if (ns6){
> > foldercontentarray[openresults[i]].style.display=''
> >
> >
>

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis > > tStyleImage="url(open.gif)"
> > }
> > else{
> > foldinglist[openresults[i]].style.display=''
> >
> >
> >
> >
> >
>

document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
> > e="url(open.gif)"
> > }
> > }
> > }
> >
> > if (ns6||ie4){
> > var nodelength=ns6? c-1 : foldinglist.length-1
> > var nodes=new Array(nodelength)
> > var openones=''
> > }
> >
> > function checkit(){
> > for (i=0 ; i <= nodelength ; i++){
> > if
> >
>

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
> > display==''))
> > openones=openones + " " + i
> > }
> > document.cookie=window.location.pathname+"="+openo nes
> > }
> >
> > if (ns6||ie4)
> > window.onunload=checkit
> > //-->
> > </script>
> >
> >
> > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > news:u%****************@TK2MSFTNGP09.phx.gbl...
> > > Todd,
> > >
> > > I meant the _cookie_ domain.
> > >
> > > Please post the code you use to create the cookie.
> > >
> > > --
> > > John Saunders
> > > Internet Engineer
> > > jo***********@surfcontrol.com
> > >
> > >
> > > "Todd" <ts****@smithdata.net> wrote in message
> > > news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > > The domain is set to my machine name (todd_sloan).
> > > >
> > > > How do I change it?
> > > >
> > > >
> > > > "John Saunders" <jo***********@surfcontrol.com> wrote in message > > > > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > > > "Todd" <ts****@smithdata.net> wrote in message
> > > > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > > > Yeah, I will try to hardcode the domain field path for the
cookie
> > and
> > > > see
> > > > > if
> > > > > > that works. If not I will just scratch everything and keep
client
> > > state
> > > > on
> > > > > > an parent IFrame or something..at least I know that works.
> > > > > > hehe
> > > > >
> > > > > Todd, that's not what I said.
> > > > >
> > > > > I said, try to find out what the domain is set to, then
learn to set
> > it
> > > > the
> > > > > right way.
> > > > >
> > > > > How are you setting it now?
> > > > > --
> > > > > John Saunders
> > > > > Internet Engineer
> > > > > jo***********@surfcontrol.com
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #33
Yeah, I guess if you spend enough time debugging your own cookie errors, you
can sometimes help some else with theirs. :-)

--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"MS News (MS ILM)" <sq**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Good job John.

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
Todd, I think someone posted in this thread that there is a problem with
cookies and hosts with underscore in the name...
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
"Todd" <ts****@smithdata.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
It is the same for both:

"MyWebProject/Menu.htm"

It works great when I type http://localhost/MyWebProject/Menu.htm into the Browser.

If does not work when I type http://todd_sloan/MyWebProject/Menu.htm into the Browser.

Odd?
"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:uO**************@TK2MSFTNGP09.phx.gbl...
> Todd, what is window.location.pathname in the case where it works and
the
> case where it does not work?
>
>
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
>
> --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
>
> "Todd" <ts****@smithdata.net> wrote in message
> news:uI**************@TK2MSFTNGP12.phx.gbl...
> > <script language="JavaScript1.2">
> > <!--
> >
> > function get_cookie(Name) {
> > //Get cookie routine by Shelley Powers
> > var search = Name + "="
> > var returnvalue = "";
> > if (document.cookie.length > 0) {
> > offset = document.cookie.indexOf(search)
> > // if cookie exists
> > if (offset != -1) {
> > offset += search.length
> > // set index of beginning of value
> > end = document.cookie.indexOf(";", offset);
> > // set index of end of cookie value
> > if (end == -1) end = document.cookie.length;
> > returnvalue=unescape(document.cookie.substring(off set, end))
> > }
> > }
> > return returnvalue;
> > }
> >
> > var foldercontentarray=new Array()
> > var c=0
> >
> > if (ns6){
> > for (i=0;i<document.getElementsByTagName("UL").length; i++){
> > if (document.getElementsByTagName("UL")[i].id=="foldinglist"){
> > foldercontentarray[c]=document.getElementsByTagName("UL")[i]
> > c++
> > }
> > }
> > }
> >
> > if (get_cookie(window.location.pathname) != ''){
> > var openresults=get_cookie(window.location.pathname).s plit(" ")
> > for (i=0 ; i < openresults.length ; i++){
> > if (ns6){
> > foldercontentarray[openresults[i]].style.display=''
> >
> >
>

foldercontentarray[openresults[i]].previousSibling.previousSibling.style.lis > > tStyleImage="url(open.gif)"
> > }
> > else{
> > foldinglist[openresults[i]].style.display=''
> >
> >
> >
> >
> >
>

document.all[foldinglist[openresults[i]].sourceIndex -1].style.listStyleImag
> > e="url(open.gif)"
> > }
> > }
> > }
> >
> > if (ns6||ie4){
> > var nodelength=ns6? c-1 : foldinglist.length-1
> > var nodes=new Array(nodelength)
> > var openones=''
> > }
> >
> > function checkit(){
> > for (i=0 ; i <= nodelength ; i++){
> > if
> >
>

((ns6&&foldercontentarray[i].style.display=='')||(ie4&&foldinglist[i].style.
> > display==''))
> > openones=openones + " " + i
> > }
> > document.cookie=window.location.pathname+"="+openo nes
> > }
> >
> > if (ns6||ie4)
> > window.onunload=checkit
> > //-->
> > </script>
> >
> >
> > "John Saunders" <jo***********@surfcontrol.com> wrote in message
> > news:u%****************@TK2MSFTNGP09.phx.gbl...
> > > Todd,
> > >
> > > I meant the _cookie_ domain.
> > >
> > > Please post the code you use to create the cookie.
> > >
> > > --
> > > John Saunders
> > > Internet Engineer
> > > jo***********@surfcontrol.com
> > >
> > >
> > > "Todd" <ts****@smithdata.net> wrote in message
> > > news:%2****************@TK2MSFTNGP12.phx.gbl...
> > > > The domain is set to my machine name (todd_sloan).
> > > >
> > > > How do I change it?
> > > >
> > > >
> > > > "John Saunders" <jo***********@surfcontrol.com> wrote in message > > > > news:uO**************@TK2MSFTNGP12.phx.gbl...
> > > > > "Todd" <ts****@smithdata.net> wrote in message
> > > > > news:OQ**************@TK2MSFTNGP10.phx.gbl...
> > > > > > Yeah, I will try to hardcode the domain field path for the
cookie
> > and
> > > > see
> > > > > if
> > > > > > that works. If not I will just scratch everything and keep
client
> > > state
> > > > on
> > > > > > an parent IFrame or something..at least I know that works.
> > > > > > hehe
> > > > >
> > > > > Todd, that's not what I said.
> > > > >
> > > > > I said, try to find out what the domain is set to, then
learn to set
> > it
> > > > the
> > > > > right way.
> > > > >
> > > > > How are you setting it now?
> > > > > --
> > > > > John Saunders
> > > > > Internet Engineer
> > > > > jo***********@surfcontrol.com
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 17 '05 #34

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

Similar topics

3
by: Pål Johansen | last post by:
Is it possible to cache portions of a page client side. I have som include pages that I would like to store at the clients cache.
2
by: Matt | last post by:
I guess the principal differences between client-side and server-side code is that client-side code is processed in web browser, and server-side code is processed in web server. In ASP.NET web...
1
by: Peter Row | last post by:
Hi, I have a web app, there is only really 1 aspx page (that the user never sees) the rest of the code is done in a DLL that implements HttpHandler. My app (which is a porting job from Vb6...
0
by: Robin Day | last post by:
I have a page that contains some dhtml and uses client side cookies so store it's current state so that on clicking the "back" button to it the page will be as the user last saw it. However,...
2
by: rk325 | last post by:
I have a question about cookies & browser permissions and turning off cookies when creating a web site (cookieless mode in web.config). I have a web site that of course uses Session variables....
6
by: dinoo | last post by:
Hi, I would appreciate if some one could help me out. I have to read a client side ini file in Aspx page and use that data in server side processing. Can any one help me out here? Please refer...
6
by: Charleees | last post by:
Hi all, I have a Login Page whrere all Functionalities such as validations are Done in Client Side... I have to Implement Remember My Mail Id and PAss Word Functionality also in Client side.....
13
by: Sanders Kaufman | last post by:
When you have a session going, I know that PHP stores a session token on the client, but does it keep the session *data* on the client, as well? Or is the session data being stored on the server,...
35
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.