Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2008



Tip: Looking for answers? Try searching our database.

session vars, CFCs and CFHTTP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wezcornell2008 - 29 Apr 2008 22:04 GMT
Hi guys

I'm using session vars to maintain whether or not a user is logged in on our
site. The only problem is is that the session vars seem to be lost after I call
a CFC that then does a CFHTTP post.

Does anyone know how I maintain the session vars?

All the best

Wez
Ian Skinner - 29 Apr 2008 22:10 GMT
> Hi guys
>
[quoted text clipped - 7 lines]
>
>  Wez

Why do you say they are lost?  Are you sure you did not just misplace them?

In other words nothing about CFC's or CFHTTP would intrinsically destroy
session variables in memory.  But they could easily not have access to
the scope as you desire if you do not understand how templates and cfml
code are associated with a given session scope when it is running in memory.
wezcornell2008 - 29 Apr 2008 22:39 GMT
Thanks for the reply.

Thank you for clarifying that the session vars are not 'lost'. I was hoping
that would be the case.

Please could you expand on how I would regain access to them through the
correct scope.

Many thanks in advance.

Wez
Adam Cameron - 29 Apr 2008 23:16 GMT
>  Please could you expand on how I would regain access to them through the
> correct scope.

Posting the relevant bits of your code and telling us exactly what's going
on, and how you've tried to troubleshoot it would be a good start.

Signature

Adam

Dan Bracuk - 29 Apr 2008 23:07 GMT
My method is to not use session variables inside cfc's.  Anything the functions need are passed as arguments.
BKBK - 01 May 2008 13:14 GMT
Wez wrote:
[i]Does anyone know how I maintain the session vars?[/i]

Yes. Do the following:

1) Navigate to Server Settings => Memory Variables in the Coldfusion
Administrator. Enable the use of application variables as well as session
variables.

2) Your Application.cfc file should at least contain a setup like this
<cfscript>
this.name = "yourAppName";
this.applicationTimeout = "#createTimeSpan(1,0,0,0)#";
this.sessionManagement = "yes";
this.sessionTimeout = "#createTimeSpan(0,0,20,0)#";
</cfscript>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.