I cannot get either example above to work in CF 10. I get the following error:
Cookie value cannot be set.
Cookie values must be strings. The value you have provided cannot be converted to a string.
The error occurred in C:\ColdFusion9\wwwroot\WebSites\XXX\mobile\login.cfm: line 11
I just tried both examples and they worked fine.
This is on an unpatched install of CF10 Developer (10,0,0,282462).
What version are you running? Perhaps a bug was introduced in a patch.