problem with cookie!! 
Author Message
 problem with cookie!!

i have a login page that contains a form with two text boxes
(text1=username, password1).  i have written a cookie that is suppose to
display the value of text1 in another page, but the result is not what
has been input into text1, can anybody help?

i have included the relevent code for both pages

thank you in advance

expireDate = new Date
expireDate.setMonth(expireDate.getMonth()+6)

userName = ""
if (document.cookie != "")
{
userName = document.cookie.split("=")[1]

Quote:
}

function setCookie()
{
userName = document.Form1.text1.value
document.cookie = "userName="+userName+";expires=" +
expireDate.toGMTString()

Quote:
}

this is the code that is suppose to display the result on the next page

<H1>
<script language="JavaScript">
if (document.cookie != "")
{
document.write("Hello, "+ document.cookie.split("=")[1])

Quote:
}

</script>
</H1>

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 21 May 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problems with cookies and Proxy

2. Problem with cookies!!

3. Problems with cookies and Proxy

4. problem with cookies

5. IIS 5.1 (Win XP) Setting Cookies via Response.Cookies collection problem

6. Cookie problems: Writing to cookie isn't changing anything

7. Reading Cookies fReading Cookies from another server in the domain

8. Duplicated cookie (update the same cookie from ASP and client script)

9. Client side set cookies and get cookies.

10. Checking for Cookie Enabled Browsers w/o persistant cookies

11. Newbie cookie problem

12. stale cookie problems

 

 
Powered by phpBB® Forum Software