Test if session is active before destroying it

This test prevent warning "session_destroy(): Trying to destroy uninitialized session"