I note that Session Settings allows you to have sessions expire as often as low as 15 minutes. However, I believe this is related to browser sessions and sure enough they do time out as expected.
However, I have a scheduled batch job (runs hourly) where I inject the Session Id as part of the initial state of the scheduled job (which then passes it to batch). The batch job then makes a callout using a REST service, e.g.:
req.setHeader('Authorization', 'OAuth ' + sessionId );
This job has been running for over a day now and the session does not appear to expire.
As it happens, this behaviour is perfect for my use case but I am concerned it won't be reliable. When will the session timeout? Can I rely on it?