To call the tag insert this code at the top of any page you want to test for session ID validity and expiration. I usually use it from a centrally located, CFINCLUDED header template so I only have to call it once:
<CF_SESSIONMONGER Visit=#Visit# MySite="YourDomainNameHere">
For max functionality make sure your CFAPPLICATION statement enables client management and sets client cookies:
You MUST initialize the Visit parameter outside the tag itself. This can be done by placing the following in application.cfm
<CFPARAM NAME="Visit" DEFAULT="0">
- VISIT (Required). The session ID. Created within the routine itself and passed back for expiration and identity testing.
- MYSITE (Required). Your domain name. Leave out the ".com", ".net" etc. if you have multiple domains parked on one location (e.g. "mysecretbase.com", "mysecretbase.net" etc.).
PASSING THE VISIT VARIABLE:
Here are five different ways to pass the variable from one page to another. Note there are different reasons to use each of these. They are just presented here as standalone examples.
<CFLOCATION ADDTOKEN= "No" URL="somepage.cfm?Visit=#Visit#">
<FORM ACTION="actionpage.cfm?Visit=#Visit#" method="POST">
<INPUT TYPE="Hidden" NAME="Visit" VALUE="#Visit#">
<META HTTP-EQUIV="REFRESH" CONTENT= "0;URL=refresh_page.cfm?Visit=#Visit#">