![]() |
|
How to change HTTP 500 to 410 when session has timed out in IntraWeb? - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: How to change HTTP 500 to 410 when session has timed out in IntraWeb? (/thread-5322.html) |
How to change HTTP 500 to 410 when session has timed out in IntraWeb? - VoAnatol - 07-25-2025 Hello! I am using Delphi with IntraWeb. When a user's session times out (due to timeout), the next request to the application returns HTTP 500 (Internal Server Error). In my application logic, HTTP 500 is incorrect, since it is not an internal error, but a known session timeout situation. I would like to return HTTP status code 410 (Deleted) to better reflect the real reason and provide client-side handling. I could not find a documented way to intercept this situation and change the response code. Is there a recommended approach to replace the status code with my own? Thanks! RE: How to change HTTP 500 to 410 when session has timed out in IntraWeb? - rlebeau - 09-03-2025 (07-25-2025, 07:02 AM)VoAnatol Wrote: When a user's session times out (due to timeout), the next request to the application returns HTTP 500 (Internal Server Error). I would have expected maybe 419 (Session Has Expired) or 440 (Login Time-out), or maybe 30x (Redirect) to a login page to establish a new session. 500 implies a real failure in the server. Is the server somehow crashing when it can't find/access an expired session? (07-25-2025, 07:02 AM)VoAnatol Wrote: I would like to return HTTP status code 410 (Deleted) to better reflect the real reason and provide client-side handling. Why 410? That status code means the resource located at the requested URL no longer exists, but previously did exist. You should not mix up resource management with session management. (07-25-2025, 07:02 AM)VoAnatol Wrote: Is there a recommended approach to replace the status code with my own? Sorry, I can't answer that, as I do not use IntraWeb. |