|
|
|
|
|
|
|
|
|
|
Using cookies in Lotus Domino applications is in your future (continued)
It's often necessary to use cookies because Domino doesn't maintain "session state." Maintenance of session state is common in modern Web servers such as IIS (Internet Information Server) or PHP (PHP Hypertext Preprocessor), but Domino seems to have missed out on this so far.
A session starts when a Web browser connects to a Web server. Session state refers to variables and other information specific to that browser session, stored at the Web server and used by server side scripts and applications. The session state is stored on the Web server for the duration of the browser's session with the Web server. The session state remains in Web server memory between page requests. Eventually the session ends (usually by expiration of a timeout period), and the session state is cleared from server memory.
The Domino server doesn't have any capacity to remember anything in between serving pages to you. Like a goldfish that forgets you every time you leave the room, the Domino server remembers nothing in between every page that it sends to you. There's nothing in Domino that keeps the thread of the conversation as you navigate around a Domino Web site.
For example, if I wanted to write a Web based bookshop application, I'd want the server to remember what books were in the shopping cart as the user browsed from page to page around the bookshop. This would be easy in IIS and PHP because they remember information about your current session with the Web server. You could store the contents of the shopping cart into a server side session variable and have that information available when the user goes to the next page.
Remembering the contents of a shopping cart is far less easy to do using Domino. If you want to remember something about what the user has done, what they have put in their shopping cart, or where they have been in your site, you need to find another way to store that information.
Cookies give you a kind of session state persistence because you they allow you to store session-specific information that can be retrieved and used during the course of the users session of interaction with the Web server.
So, session state persistence means that information about the state of the users session of interaction with the Web server stays in the server's memory for the time that the user continues to interact with the Web server (i.e., it persists in the memory of the Web server).
Now before you flame me, I apologize in advance if Domino does support persistent session state when using servlets, however servlets aren't my field of expertise and this article is about cookies, not servlets.
How cookies work Fortune cookie says: "You never hesitate to tackle the most difficult problems."
As mentioned previously, a cookie is a little chunk of text that is stored at the Web browser and is returned to the Web server with each page request that the client makes to the server.
A cookie is created at the client Web browser either by sending it from the server to the client in the HTTP (Hyper Text Transfer Protocol) response header, or by executing some client side Javascript that creates a cookie on the client. In this article we will be creating cookies using Javascript. We won't be dealing with the creation of cookies via the HTTP response.
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
The Ultimate Notes Domino Training Experience - Amsterdam, 11-13 November
Get in-depth technical training that you can put to use on the job right away at THE VIEW's Admin2008 and Lotus Developer2008 Europe! One registration gets you into your choice of over 70 new and updated expert know-how sessions, one-on-one consultations, hands-on labs, and more.
See complete agendas and register by 10 October to save 495 euros! |
|
|
|
|
|
|
|
|