fix getState() returned type

when cookie is not existing, return undefined
Merge pull request #58 from SKAhack/fix-cookie

fix getState() returned type