In our application when user clicks at specific button on the page http callout to external service is triggered from apex code on the server side. As one of the parameters we are passing session id to this external service, since it needs to have access to the org to read some info through Rest API and create some data as well. It takes usually couple minutes for external service to do its job.
This approach of sharing session id works in general. But the problem appears when user logs out right after initiating callout. This invalidates the session, so external service immediately loses access to the org.
Is there anyway to get session id which would not be invalidated on user log out? Any other better approaches how to give access to external service to org under current user?