Javascript cookies not accessible until second attempt

When my login form is submitted, the cookie is created and a simple alert message retrieving the cookie tells me it is OK. The submission calls an agent which processes stuff and then directs to a welcome page. This welcome page accesses the cookie to create a simple message containing the user name on the header. All quite straight forward I thought. However, the first time a user does this, their name does not appear. If they repeat the login process, then the name does appear. A user seems to need to login twice before the cookie is accessible. Any ideas?Thanks,

Chris

Subject: javascript cookies not accessible until second attempt

Make sure the cookie is setting the same domain otherwise you will have multiple logins.

Eg if you login with full hostname:

www.mysite.com/loginform?openform

as opposed to:

mysite/loginform?oopenform

Alert the cookie values and especially the domain. This can be done in the in tools/internet options/security/internet/custom level. Set alert cookies