View comments | RSS feed

URLSessionFormat

Description

Depending on whether a client computer accepts cookies, this function does the following:

This function automatically determines which identifiers are required, and sends only the required information. It provides a more secure and robust method for supporting client identification than manually encoding the information in each URL, because it sends only required information, when it is required, and it is easier to code.

Returns

A URL; if cookies are disabled for the browser, client and session data are appended.

Category

Other functions; Maintaining client identity in Using Persistent Data and Locking in ColdFusion MX Developer's Guide

Function syntax

URLSessionFormat(request_URL)

Parameters

Parameter Description

request_URL

URL of a ColdFusion page

Usage

In the following example, the cfform tag posts a request to another page and sends the client identification, if required. If cookie support is detected, the function returns the following:

myactionpage.cfm 

If the detected cookie is not turned on, or cookie support cannot be reliably detected, the function return value is as follows:

myactionpage.cfm?jsessionid=xxxx;cfid=xxxx&cftoken=xxxxxxxx

Example

<cfform 
method="Post"
action="#URLSessionFormat("MyActionPage.cfm")#"> </cfform>

ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


tommyviper said on Sep 22, 2005 at 9:31 AM :
Our testing has found that this:
"If the client accepts cookies: does not append information "

should actually read as this:
"If the client accepts cookies: does not append information, IF 'use J2EE session variables' is enabled in the CF Administrator"

Using MX7 Ent. on IIS - disabling J2EE caused this function to ignore whether or not the client accepts cookies.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000660.htm