Cookie Domain

I am creating cookies in php and in js. When I create it in php, the domain shows as .mysite.com but when I create it in js, even though I am setting it at .mysite.com, when the cookie is created it is ending up as www.mysite.com so I have two sets of cookies out there.

The function call is


Set_Cookie("cset", "J4", 90, "/", ".mysite.com", "");

The function code is


function Set_Cookie( name, value, expires, path, domain, secure)
{
	var today = new Date();
	today.setTime( today.getTime() );
	
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
};

The resultant cookie from this call is cset, J1, www.mysite.com

Try getting rid of the . off the front of the domain name