Change the server session expiry message

I am looking to customize the server message and heading that appears when a session expires in my application hosted on Frappe Cloud. I attempted using monkey patching but it’s not effective.

Could anyone suggest an alternative approach to achieve this customization? Any detailed steps or examples would be greatly appreciated.

Thank you!