Session Management

1.rewriting

Make the id contained in the hyperlink, such as "TestServlet?id=12". You can append many name/value pairs on the URL, if the length of new URL doesn't exceed the limit.


2.hidden field

Put the value in the html page and doesn't display the value. For example, "<input type=hidden name='flag' value='123'>"


3.cookies

Send the name/value pairs to the browser with the response. If the browser sends a new request, the cookies is included in the request to the server.


4.session objects

Session objects don't like cookies that send the value to the client. Instead, session objects are maintained in the server and send the session identifiers to the client by URL rewriting or cookies.

你可能感兴趣的:(Session Management)