if u set a cookie with javascript, the cookie name can will be assigned as a php variable. qouted from php doc.:
"Note that the value portion of the cookie will automatically be urlencoded when you send the cookie, and when it is received, it is automatically decoded and assigned to a variable by the same name as the cookie name."