Fatal error: in base_facebook.php on line 1039-Collection of common programming errors

I am getting the following error

Uncaught OAuthException: An active access token must be used to query information about the current user.

My frame application consists of two pages – index.php and index1.php. By default when index.php loads, it has following link to index1.php at the top:

index1

and also the following code:


index1.php has same code at the top as index.php is has.

When I load application it doesn’t give any error and loads perfectly, but when I click on link to index1.php it gives

Uncaught OAuthException: An active access token must be used to query information about the current user in base_facebook.php at 1039

How can I fix this?