One way to support anonymous session tracking is to use hidden form fields.
As the name implies, these are fields added to an HTML form that are not displayed in the client's browser.
They are sent back to the server when the form that contains them is submitted. You include hidden form files with HTML like this:
Code of index.jsp
In a sense, hidden form fields define constant variables for a form. To a servlet or JSP receiving a submitted form, there is no difference between a hidden field and a visible field.
Code of nextpage.jsp
The advantages of hidden form fields are their ubiquity and support for anonymity.
Hidden fields are supported in all the popular browsers, they demand no special server requirements, and they can be used with clients that haven't registered or logged in.
The major disadvantage of this technique, however, is that the session persists only through sequences of dynamically generated forms. The session cannot be maintained with static documents, emailed documents, bookmarked documents, or browser shutdowns.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.