> I have a
> <cfinclude template="secure.cfm">
> at the top of my cfm templates.
>
> This is secure.cfm:
> <!--- User has yet to login --->
> <cfif '#Session.User#' IS "">
>     <cflocation url="login.cfm">
> </cfif>
>
> The small secure app that I've been using is working well,
> except for when the variable Session.User does not exist -
> for example, I have a page called info.cfm (with the
> cfinclude for secure.cfm) - If I load up my browser, enter
> the URL and file name (info.cfm), I would like for it to
> default to login.cfm and prompt for a login, not display an
> error message (The session variable USER does not exist.)  I
> also get the same when the session times out.
>
> Is there a way that I can say [if variable Session.User does
> not exisit, create Session.User with value ""]?  This would
> default to login.cfm?

<CFParam> the variable or use isDefined()

Also, don't put <cfif '#Session.User#' IS "">, put <cfif Session.User IS "">
Otherwise you're forcing CF to put the variable into a string, which means
you should work out things like balancing the apostrophies

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to