A brief discussion of logging in and out in Farcry. Farcry handles redirection beautifully (in my opinion). This is important when using a custom login page and/or members only section. If a user clicks on a link that is part of your member’s only section, you display the login form. But, how do you get them to the correct page once they’ve logged in? I say, very easily, that’s how.
Here’s an example of a members login link:
<a href="#application.config.general.adminserver#/farcry/login.cfm?returnUrl=#cgi.script_name#?#cgi.query_string#">Members Login</a>
You see, the login page that is referenced here first looks to see if you have a custom login form. If not it displays the default. All the default login pages can take a returnUrl parameter which is the page to re-direct the user to after a successful login takes place. In this case, #cgi.script_name#?#cgi.query_string# will pass something like index.cfm?objectid=0FE24133-9027-F64A-79D83E62FD5FF288 to the login page. Of course, that object id is based on the page they have requested.
Now, what about logging out? Why, that’s even easier! Here’s an example of that link:
<a href="#application.config.general.adminserver##cgi.script_name#?logout=1&#cgi.query_string#">Logout</a>
This is just a link to the page the user has requested with logout=1 passed somewhere in teh query string. The index.cfm conjurer page will automatically clear out the user’s session if this is detected.
Pretty slick, huh? Farcry really is a beautiful tool!

Related Articles
No user responded in this post
Leave A Reply