Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change HTTP 500 to 410 when session has timed out in IntraWeb?
#1
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!
Reply
#2
(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.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)