session_renew function

Checks current session and re-authenticates if necessary