Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Cookies example

Your login page would obviously run a WQS agent when submitted. Assuming the agent finds a matching user profile for the user name and password that was submitted you would then set a cookie and open a post-login page for the user by using something like this at the end of the agent process:

Print |Set-Cookie:UserID=JohnDoe|
Print |Location: /MyDB.nsf/MyForm?openform|

Then in your other web pages check to make sure that the cookie has an appropriate value or else redirect the user to the login page. You can use something like the following, placing the cookie test in the onLoad event and the getCookie() function in the JS Header.

var cookie = getCookie("UserID");
if(cookie==null){
window.location.href="Login?OpenForm";
}


function getCookie(cookieName)
{
if(document.cookie)
{
var index = document.cookie.indexOf(cookieName);
if (index != -1)
{
var countbegin = (document.cookie.indexOf(cookieName+"=", index) + 1);
var countend = document.cookie.indexOf(";", index);
if (countend == -1)
{
countend = document.cookie.length;
}
return document.cookie.substring(countbegin + cookieName.length, countend);
}
}
return null;
}


Feedback response number WEBB7ZJ57M created by ~Delores Nongerobergjip on 01/09/2010

Creating a login without a notes ac... (~Hal Dwoboosily... 7.Jan.10)
. . non-Notes ID logins (~Delores Nonger... 8.Jan.10)
. . . . non notes ID logons (~Hal Dwoboosily... 8.Jan.10)
. . . . . . Cookies example (~Delores Nonger... 9.Jan.10)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS