I think this has something to do with the fact that I am using Joomla 2.5.9. It looks like maybe the sytax changed? I tried to figure this out myself, but I am not that great with php. Could you lend a hand?
I am having this issue also. Only registered users can access the page that I have this on. I tried making this both as a custom module that was available to registered users only as well as an article that was available to registered users only and got the same result both times. Do you have any ideas about how to correct this?