201 HttpSession with URL Rewriting | Technique 4 Session Tracking | Session Handling | Management
Автор: tech fort
Загружено: 2020-05-25
Просмотров: 132
Описание:
Technique 4(Session Handling/Tracking): HttpSession with URL Rewriting:
Hidden Form Filds
Cookies
HttpSession with Cookies
The third technique i.e. HttpSession with Cookies uses in-memory cookies to send session-id to browser window along with the resposne from web resource program and to send session-id back to web application along with the request from browser window.
Due to this session tracking of HttpSession with cookies techniques fails, if cookie are restricted coming to browser window OR if cookies are deleted in the middle of the session, from web applications by using browser settings.
To overcome above problem do not depend upon cookies to send and receive session-id along with request and response to/from browser window respectively.
This above problem can be solved using HttpSession with URL Rewriting:
For this we can append session-id to a url that goes to browser window along with response and comes back to web application from browser window along with the request. This process is called as "URL Rewriting". Since HttpSession object is also involved in this URL Rewriting, this process is technically called as "HttpSession with URL Rewriting" session tracking/handling/management technique.
If web resource program of web application generates dynamic form pages then the URL palced in "action" attribute of form tag comes to browser window along with the response and goes back to web application along with the request submitted by dynamic form page. So, in HttpSession with URL Rewriting technique we can append Session-Id to this URL.
response.encodeURL("servletURLOrDestinationUrl");
response.encodeURL(-) method can append Session-Id of current HttpSession object to the given URL as shown below:
response.encodeURL("homeURL");
gives output like
homeURL;jsessionid=alphaNumericValue
Eg: servletURL;jsessionid=B5678HOS99A9LE99
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: