We have an array of autoscaling web servers on the cloud sharing sessions via a shared Network Attached storage.
We are considering other solutions but in the meantime I am looking for ways to make our system fault tolerant.
E.g. if shared storage is not available for whatever reason I would like php to ignore my session.save_path setting and fallback to the local filesystem instead.
Is there any clever workaround that would make this possible via standard php configuration?
You could use
auto_prepend_fileand do the check there and set the path to local if the path in the cloud is not available. This is not a fully automatic, ini only solution, but close to it.Recommendation: if you want to share the session across several machines better use a database stored session solution.