<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2722.900" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff size=2>Here
is how I am setting it, this code is within a Perl script. I set the
cookie to the username the person just logged in with and then I get the cookie
in my header code. As you can see I set up an alert to see the value of
the cookie before I do anything with it. This is for testing purposes
only.</FONT></SPAN></DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff size=2>Hope
this helps.</FONT></SPAN></DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff size=2>print
"<SCRIPT LANGUAGE=\"JavaScript\">\n";<BR>print "<!-- \n";<BR>print
"set_cookie('username','$fields{'txtusername'}');\n";<BR>print "// -->
\n";<BR>print "</SCRIPT>\n";</FONT></SPAN></DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff size=2>And
here is how I am getting it:</FONT></SPAN></DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=577100018-25112002><FONT face=Arial color=#0000ff size=2>print
"<SCRIPT LANGUAGE=\"JavaScript\">\n";<BR>print "<!-- \n";<BR>print "
alert(get_cookie('username'));\n";<BR>print " if (get_cookie('username') !=
null) {\n";<BR>print " document.write
('<table>');\n";<BR>print
" document.write
('<tr>');\n";<BR>print
" document.write ('<td
colspan=2 align=center><span
class=inputheader>'+get_cookie('username')+'</span></td>');\n";<BR>print
" document.write
('</tr>');\n";<BR>print "
document.write ('</table>');\n";<BR>print " }\n";<BR>print "
else {\n";<BR>print " document.write
('<form method=\"post\" name=\"frmlogin\"
action=\"\.\.\/cgi-bin\/football_survivor_log_in.pl\">');\n";<BR>print
" document.write
('<table>');\n";<BR>print "
document.write ('<tr>');\n";<BR>print
" document.write ('<td
colspan=2 align=center><span class=inputheader>Log
In</span></td>');\n";<BR>print
" document.write
('</tr>');\n";<BR>print "
document.write ('<tr>');\n";<BR>print
" document.write
('<td><span
class=inputheader>username</span></td>');\n";<BR>print
" document.write
('<td><input type=text name=txtusername
maxlength=25></td>');\n";<BR>print
" document.write
('</tr>');\n";<BR>print "
document.write ('<tr>');\n";<BR>print
" document.write
('<td><span
class=inputheader>password</span></td>');\n";<BR>print
" document.write
('<td><input type=password name=pwdpassword
maxlength=25></td>');\n";<BR>print
" document.write
('</tr>');\n";<BR>print "
document.write ('<tr>');\n";<BR>print
" document.write ('<td
colspan=2 align=center><input type=submit value=\"log
in\"></td>');\n";<BR>print "
document.write ('</tr>');\n";<BR>print
" document.write
('</table>');\n";<BR>print "
document.write ('</form>');\n";<BR>print " }\n";<BR>print "// -->
\n";<BR>print "</SCRIPT>\n";</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Terry
[mailto:bader@tcbader.com]<BR><B>Sent:</B> Monday, November 25, 2002 12:59
PM<BR><B>To:</B> javascript@LaTech.edu<BR><B>Subject:</B> Re: [Javascript]
ughh HELP WITH COOKIES PLEASE!!!!<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Please show us how you are calling the
function...</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>~ Terry<BR>757 581-5981<BR>AIM/Yahoo:
lv2bounce</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=MPodlesny@acsisinc.com
href="mailto:MPodlesny@acsisinc.com">Podlesny, Michael</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu
href="mailto:'javascript@LaTech.edu'">'javascript@LaTech.edu'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, November 25, 2002 12:52
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Javascript] ughh HELP WITH
COOKIES PLEASE!!!!</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=522445017-25112002><FONT face=Arial size=2>ughh HELP WITH
COOKIES PLEASE!!!!</FONT></SPAN></DIV>
<DIV><SPAN class=522445017-25112002><FONT face=Arial size=2>The code below
only saves my cookie for the page in which it is set. Does anyone have
any ideas as to why my cookie is deleted when I access the another page on
my sitter?</FONT></SPAN></DIV>
<DIV><SPAN class=522445017-25112002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=522445017-25112002><FONT face=Arial color=#0000ff
size=2>here is the code</DIV>
<DIV><BR></DIV></FONT></SPAN>
<DIV><FONT face=Arial color=#0000ff size=2>function set_cookie(name, value,
expires, path, domain, secure) {<BR> var curCookie = name + "=" +
escape(value) +<BR> ((expires) ? "; expires="
+ expires.toGMTString() : "") +<BR> ((path) ?
"; path=" +<SPAN class=522445017-25112002> path </SPAN>: "")
+<BR> ((domain) ? "; domain=" + domain : "")
+<BR> ((secure) ? "; secure" : "");<BR>
document.cookie = curCookie;<BR>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2>// name - name of the
desired cookie<BR>// * return string containing value of specified cookie or
null if cookie does not exist<BR>function get_cookie(name) {<BR> var
dc = document.cookie;<BR> var prefix = name + "=";<BR> var begin
= dc.indexOf("; " + prefix);<BR> if (begin == -1)
{<BR> begin = dc.indexOf(prefix);<BR> if
(begin != 0) return null;<BR> } else<BR> begin +=
2;<BR> var end = document.cookie.indexOf(";", begin);<BR> if
(end == -1)<BR> end = dc.length;<BR> return
unescape(dc.substring(begin + prefix.length, end));<BR>}<BR><SPAN
class=522445017-25112002></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=522445017-25112002></SPAN></FONT></FONT></FONT> </DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>