is_user_logged_in() not available to plugins?

Hello,
I know, this might not be the correct place to ask, but I know there are people here that might know the answer... :slight_smile:

I am writing a plugin that loads some custom stuff to Wordpress bar. I need to decide inside my plugin if the user is logged in or if its an anonymous user.

According to Wordpress Codex I should call is_user_logged_in() but when I do I get "Fatal error: Call to undefined function is_user_logged_in()".

It seems like this function is not available to plugins? What could I use instead to determine logged in/anonymous?
Code;

<?php
/*
Plugin Name: Skolbloggen.se
Description: Does stuff
Version: 1.0
Author: Måns Larsson
*/

if (is_user_logged_in())
{
/* do some stuff */
}
else
{
/* do some other stuff */
}
?>