> I hope this is not off topic, but if someone can ask about hard drive
> partitions then I figure anything should go.
>
> I have a page that sets a session variable
>
> <cfset session.myvariable="somevalue">
>
> then I do a cflocation
>
> <cflocation url="SomeNewPage.cfm">
>
> On that page I have a statement that says:
>
> <cfoutput>#session.myvariable#</cfoutput>
>
> Which gives me the error
>
> Error resolving parameter SESSION.myvariable
> The session variable myvariable does not exist. The cause of this error is
> very likely one of the following things:
> The name of the session variable has been misspelled.
> The session variable has not yet been created.
> The session variable has timed out.
>
> If I take out the cflocation tag and just put that cfoutput
> statement on the
> first page it works correctly. The only thing I can guess is that CF is
> going to the new location before it sets the session variable. Anyone got
> any suggestions?
OK, here's the reason - session variables are stored by using cookies or URL
variables to tag the user - when you use CFLocation, the browser isn't sent
the cookie or URL variables, and thus they are lost
Either don't do a CFLocation and call the real template just below or use
JavaScript and a hyperlink to skip to the next page
Or, why not set the Session variables in Application.cfm if they don't
exist?
Philip Arnold
Director
Certified ColdFusion Developer
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.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists