Home
| | Sitemap
||Page number :12
Programmer's Guide Nokia WAP Server API 1.1 page 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
previous || guide home || next
5.3 Session tracking
It is often necessary to keep track of how a user navigates in a WAP service and what kind of interrelated actions the user performs within one WAP session (e.g. what items are collected into a shopping cart). Thus, the WAP application has to be able perform session tracking. There are several alternatives for implementing session tracking with the Nokia WAP Server.
All the options below are possible for implementing session tracking, and there is no single right way to implement session tracking in WAP applications. The best practice should be selected case by case, depending on the application type (e.g. the amount of information that is tracked during the session).
5.3.1 Services for session tracking via the HttpSession interface
The standard Java Servlet API defines the HttpSession interface, which enables session management. For details of the use of the HttpSession interface, see [1].
Note: URL rewriting is implemented in the Nokia WAP Server API as defined in the Java Servlet API, but instead of cookies, the Nokia WAP Server implementation uses WSP session IDs for session identifying. However, also note the following remarks and other optional ways for implementing session tracking.
Servlets in the Nokia WAP Server
29
| WSP Session ID | The Nokia WAP Server creates a unique session ID for each WSP session. The WSP session is created only in the connection oriented mode and you should note that e.g. Nokia 7110 creates a new WSP session for each CSD call. For additional information on the WSP protocol, see [3] |
|---|---|
| The session ID can be retrieved also for application session handling purposes via the WapRequest interface by using the getWapSessionId()method. | |
| Note: the WSP session IDs are the same for all the servlets. Thus, several servlets can utilise the IDs created by the Nokia WAP Server. |
5.3.2 WML code
WML variables retain their values between requests and thus are a nice way to implement session tracking. WML code generated e.g. by servlets (or some script on the origin server) can thus include the necessary session information in the form of variables. For further information, see e.g. the WML Reference document included in the Nokia WAP Toolkit.
5.3.3 Other optional ways to implement session tracking
| WTLS Session ID | The Nokia WAP Server creates a unique ID for each WTLS session. This ID remains the same for subsequential WTLS connections, depending on the terminal implementation (in the case of Nokia 7110, the ID remains the same). The session ID can be retrieved for application session tracking purposes via the WapRequest interface by using the getWtlsConnectionId()method. Note: WTLS session IDs are the same for all the servlets. Thus, several servlets can utilise the IDs created by the Nokia WAP Server. |
| Cookies | Cookies can be used e.g. by the origin server to handle sessions in the WAP application. In that case, the Nokia WAP Server will pass the cookies from the origin server to the terminal and vice versa. However, it is important to notice that not all WAP terminals (such as Nokia 7110) support cookies and thus the use of this option should be considered very carefully. |
Programmer's Guide Nokia WAP Server API 1.1 page 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
previous || guide home || next