Thank you for your reply Corion but it doesn't seem to matter that much the problem is with the ->value. If a cookie doesn't exist it flags a 'Can't call method "value" on an undefined value at line #' because it's trying to read a value from a cookie that doesn't exist? I was using the if (exists $cookies line to lose the error but when a cookie does exist the if line seems to stamp on the data leaving it undef?