How can I get HttpServletRequest when in an HttpSessionListener?

后端 未结 3 786
一整个雨季
一整个雨季 2021-01-18 06:21

How can I access request headers from a SessionListener?

I need to set a timeout on the current session when it is created. The timeout needs to vary based on a head

3条回答
  •  天命终不由人
    2021-01-18 07:05

    You can't ( see the API ). The request allows you to access the session, but not the other way around.

    You might even have concurrent requests for the same session, so this is not feasible.

提交回复
热议问题