Get information about user from cookie

Hi everybody
is it possible to get information about user (name, id etc) from vanila cookie ? I want connect vannila with my system and I want to use login on vanila. And if user is loged and have some role, he can get to another part of websites.
And I need to decrypt cookie somehow.
I found this https://gist.github.com/700805/a98274daaf338df1fbd76a28a733d8698d7311b5 and I supose it is what I need. But it is not working :-(
thank you for replies.
0
Comments
To do that, you must include Vanilla's bootstrap.php, and then call a new Gdn_CookieIdentity() object in your code. If you need a web developer, I'm available for hire.
Add Pages to Vanilla with the Basic Pages app
Thank you for kicking me with bootstrap.php.
here i found function code http://themeforest.net/forums/thread/vanilla-forums-authenticate-outside-forum/38138?page=1.
Once again - thank you. If I will need something, I will contact you. Thanks