Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
How to use cookies with Notes and the Web (continued)

It is also possible to pass other client information, such as a user name or the current database, from Notes to the Web client in this fashion, even though the Web agent is being accessed as an anonymous user. This information would otherwise be completely unavailable to the Web agent. Essentially, a second method of creating an agent context has been created, in addition to the DocumentContext available from the NotesSession class.

Creating a cookie
There are many different ways to create cookie values. One simple solution is to use the @unique formula function. It doesn't matter what formula is used, since the button or action which creates the cookie document in Notes also builds the URL with the cookie as a parameter. For extra security, an expiration date/time can be built in, which doesn't need to be any longer than the time between the button being pressed and the URL being processed by the Domino server.

A sample database, with code ready to try out, is available for downloading to accompany this article. All code is tested on R4.6 platforms and upwards, and is provided free of charge for you to play with, use, or modify. Get it from http://www.rhizomatics.demon.co.uk/software/nwauthen.zip.

Requirements
There are three major things you should keep in mind when you are creating cookies:

  • First, the cookie creation code in the Notes form must make the Web agent call the number. As shown in the code samples later in the article, this can be incorporated even in a simple formula language button call to a URL.

  • Secondly, the cookie-checking code in the Web agents of databases must require Web authentication. These databases must have anonymous access of Reader or greater, which is required for all Web users to run agents.

  • Lastly, you must have a "cookie jar" database in which to store the cookie documents. This database must have default access of Depositor (to allow remote Notes clients to drop in cookie documents). Only one agent is required in this database -- the scheduled Expire Old Cookies agent used to purge stale cookies.

Performance
A scheduled hourly agent performs expiration of cookies in the sample database. It might seem more obvious to build the expiration test into the selection formula of the view, but this would create an unstable view, permanently in need of regenerating.

Further performance improvement can be achieved by changing the "Remove Documents not modified in the last" setting in the database Replication Settings to 0 days. This ensures you that when cookies are deleted, they disappear completely from the database and do not leave replication stubs behind.

Security
Since your Web users don't need any access to the cookie jar database (all access to cookies is performed by the Web agent) and Notes clients only require Depositor access to allow them to create a cookie, any Web client can check a cookie for validity. No Web client, however, can create or view a cookie, nor can a Notes client read current cookie values. Reader access is required for the signer of the Web agents (usually the Notes developer or an administrator who has used the Sign All Agents facility in Notes Administration), since by default agents are run with the signer as their effective user ID.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Internet Technologies > Logging and analysis (8 articles)
   Boost your server performance with HTTrack
   Keeping user credentials in a frameset
   Using probes to monitor your Domino servers
Home > Lotus Technologies > Notes (84 articles)
   A walk down Memory Lane with Lotus Notes
   An application for scanning physical mail and distributing it virtually
   Managing Notes deployments with Teamstudio Build Manager
Home > Internet Technologies > HTML and CSS (15 articles)
   Using a reusable code approach to HTML select option lists
   One reader's opinion on HTML mailing
   Keep lookin' good with Cascading Style Sheets
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.

Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).

Tap here to get started!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login