Its a good idea to place a “Logout” button on any applicaiton that requires a user to authenticate before accessing a Notes database/application over the web. If you’ve done this on a site with frames, you may have seen that Domino has some funky ideas about how to process a log-out command.
Occasionally, all of the pages in the active frameset will relaod with the default login page – individually. Leaving you with a site that has about 4 login pages within a frameset. In most cases, this can be fixed by using a target frameset setting in the frameset’s properties. However, for the times when that doesn’t work, I offer the following two options.
Method A: Code
1. Create an Action Hotspot on your form/page. Call it “logout” (or whatever)
2. In the Hotspot property’s “info” tab, set the Frame field to be _top
3. Use the code below for the hotspot:
Code:
dbpath := @ReplaceSubstring(@Subset(@DbName; -1); “”:” “; “/”:”+”); @URLOpen(“/” + dbpath + “?logout”)
The code compensates for the database paths and server types and opens a relative URL with the text “?logout” appended … which is the piece that actually, ya’know, logs you out.
Method B: Funky Redirects This option is a bit more work, but produces a really nice result that’s clean and gives the user the illusion that more is happening during the logout process than they may realize.
1. Create a form called “Redirect-Logout”
2. Place a compluted field called “$HTMLHead” on the form
3. Make the value of this field to be: (shown below, including quotes)
Code:
“[<meta equiv="REFRESH" content="1; URL=http://www.mywebsite.com/database.nsf/?Logout">]“
4. On the page, you may want to add a quick piece of text that says “Logging out” or something. Also, you can change the “1″ in the code above to “0″ to eliminate a one-second delay in reloading the page.
(“1″ means it’ll hold on the page for 1 second, “0″ would simply redirect it immediately. You can use any number you want, in seconds.)
5. Create “Logout” links on your website (on each page that’ll load in the secured portion, or in a menu, or whatever). The “Logout” link’s code should look like this:
Code:
< a xhref="http://www.mywebsite.com/database.nsf/Redirect-Logout" mce_href="http://www.mywebsite.com/database.nsf/Redirect-Logout" target="_top"&ht
* Make sure to specify the “target” portion … that’ll ensure that you clear all frames just before processing the logout in the page you’re driving them to.There you have it! Two ways of logging out cleanly on your site. — Personally, I use “Method B” all the time because I like the idea of being sure to clear frames and giving people a page that tells them the logout is being processed … it makes it look like I spent a lot of time writing a security structure backend or something. No one has to know that its buit in to Notes/Domino but you. Well, and other developers.
What people here are saying…