Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP request from a browser upon a session timeout

I have UI that is served by two HTTP servers. Therefore I need to clean the HTTP session from both servers. It is simple for the logout use case but not clear for me how to do it for the session timeout use case.

The notification on the server side is possible via HttpSessionBindingListener Getting notification when bounded/unbounded to a HTTP session. But how can I notify the client site about it? I have to send the request from a browser to the second server to be able to clean a session cookie on the second server and therefore I can not send request from the server side.

Added

One server is Tomcat 8, the second server is Apache HTTPD server. I want to solve it via UI callback is possible (from the Tomcat HTTP servlet server).

like image 765
Michael Avatar asked Sep 19 '16 15:09

Michael


People also ask

What is HTTP session timeout?

Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by a web server). The event, on the server side, changes the status of the user session to 'invalid' (ie.

How do I extend my browser session timeout?

Type KeepAliveTimeout, and then press ENTER. On the Edit menu, click Modify. Type the appropriate time-out value (in milliseconds), and then click OK. For example, to set the time-out value to two minutes, type 120000.

What can cause session timeout?

If your Internet connection is unstable, periodically disconnecting and reconnecting, it can cause a website session to expire. When the Internet connection is lost the website connection can be terminated, resulting in a session expired message if you try to access any page after the Internet reconnects.

How do you check website timeout?

If you want to determine when the countdown for timeout starts, you can can go to the Logic tab, right-click on the Server Actions folder, select Add System Event and then On Begin Web Request. This will create an action that will run every time your module handles a new request.


1 Answers

From Apache HTTPD (Apache) documentation:

Integrating Sessions with External Applications

https://httpd.apache.org/docs/2.4/mod/mod_session.html#integration

  • You can write your own module, then you could use this module to delete sessions after Tomcat deems them expendable.
  • You can use a session database external to both Tomcat and Apache (eg. in MySQL), both servers would validate users with it. Deleting a session would just require deleting the entry from the database.
  • As a standalone application: As the docs state, it is on you to do the work of finding and accessing the session files, breaking them, and editing them. If Tomcat and Apache are on different machines, you could have an agent with a listener on the Apache box, and have Tomcat request the agent delete the session data.
  • Apache usually goes with PHP, and there is also databases around. Both could have their own sessions to handle.
like image 97
gia Avatar answered Nov 09 '22 08:11

gia