|
Back to the top of the FAQ
Applies To
The CookieSWValue (cookie site-wide value)
returns a value of the form
<username>cryptvalue
where cryptvalue is the standard MD5 (crypt) hash of the username and the
user's password. Available in Version 4.6c and above.
For cookie-based installations of AuthentiX only:
With later versions of ASP.NET, the "<" and ">" delimiters are considered to form
a possible XSS attack.
The code below will have to be modified also to match
your delimiters.
Use like this:
See the ASPocxSamples\EasyCookieLogin sub-directory of the installation directory
for a working sample.
If you need to get the CurrentUserName with CookieSWValue, just get the
plain-text username out of the AXCOOKIELOGIN cookie (ie the part of the value of the
cookie that comes before the "<").
Confusion Alert (3/20/00)
Because the
cryptvalue/username is enclosed in "<" and ">" it will not show up in a simple
response.write statement since the browser thinks it's a tag. This is good if you want
to conceal this information from casual observers, bad if you are trying to debug.
This function is provided so that a login cookie can be set for the entire site.
Unlike the CookieLoginCookieName,
CookieLoginValue
and
CookieCurrentUserName
family (where cookies are set for each protected directory), CookieSWValue is site-wide.
Note that protection only applies to directories which have been
set up as AuthentiX cookie-protected directories
(see the Protect-by tab, and the cookie Configure button).
CookieSWValue is easier to setup.
CookieLoginValue
has the advantage that a single
browser can log in to different directories of a website with different username/pasword combinations
on each, and not have to resubmit each username and password when navigating between the different directories.
CookieLoginValue runs into problems however when there is a dynamically changing set of protected directories,
or when there are a large number of separately protected directories.
CookieSWValue allows you to easily set the password for many, many directories, that may change dynamically
over time.
If cookie-timeouts
are required, then be sure to set each protected directory's Cookie-timeout radio button.
Note however that if you are using site-wide cookies, the timeout value in the
Options/Cookie
dialog overrides the timeout value for
each individual directory's timeout setting.
Cookie-timeout note (2/19/04):
The cookie-timeout is checked periodically, and this period is defined in the
"Minutes between cache cleanup" section of
this dialog.
If you set the cookie-timeout to be quite low (eg 5 minutes), then make sure the
"Minutes between cache cleanup" is less or lower.
Notes - GetCrypt
then compare the result against the supplied password. (Please correct my SQL Stored
procedure syntax). Note, the progid is "AXSUPPORT.AXSupportCtrl.1".
Unlike Basic Authentication, site-wide cookie-protection
uses MD5 hashing to encode the password.
When it looks up the password in the database,
it cannot compare it directly to the supplied password, because
the supplied password is MD5 encrypted.
What it does instead is MD5 encrypt the password in the database,
and compare it to the supplied password to see if it matches.
See
here
for more examples
of how to call general OCX components
from languages such as Perl and SQL (the samples do
not use the above functions however).
Syntax
CookieSWValue(Username, Password)
Parameters
Return Values
Returns the initial cookie value to be used when first accessing a
cookie protected directory.
Example
See the ASPocxSamples\EasyCookieLogin sub-directory of the installation directory
for a working sample.
Applies To
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
|
|