Conversational state: session management(Head First Servlets and JSP)
Somehow, the Container has to get the session ID to the client as part of the response, and the client has to send back the session ID as part of the request. The simplest and most common way to exchange the info is through cookies.
If the client won’t take cookies, you can use URL rewriting as a back-up. Assuming you do your part correctly, URL rewriting will always work—the client won’t care that it’s happening and won’t do anything to prevent it. Remember the goal is for the client and Container to exchange session ID info. Passing cookies back and forth is the simplest way to exchange session IDs, but if you can’t put the ID in a cookie, where can you put it? URL rewriting takes the session ID that’s in the cookie and sticks it right onto the end of every URL that comes in to this app.
转载于//www.cnblogs.com/zhtf2014/archive/2010/05/09/1731421.html
还没有评论,来说两句吧...