Expected OAuth 2 access token after I refresh the page

  javascript, oauth-2.0, php

When I signin for the first time authentication works and I can update Google Sheets data as many time as I want.
But when I refresh the page it gives me this error "Expected OAuth 2 access token, login cookie or other valid authentication credential" Requires authentication again.
In docs says that it access token expires in 1 hour.

Source: Ask Javascript Questions