Coldfusion Login Code Fails - No error

Hi Folks,

Struggling with this one - largely because I'm not seeing any errors returned.

My code below is processed following a login form, it basically checks that the details are correct, sets some session variables and should redirect the user to the 'logged in' page.

At the moment, it appears to get as far as line 23 (starting the CFC) then just stops - no errors shown, and no further page processing completed (I've left my 'quick and dirty' debug text in place below - the page doesn't print 'MonkehTweet part one complete').

If (after processing this) I manually navigate to home.cfm, it works as it should which suggests the session variables are being set correctly.

I can't figure out why it's chocking with the CFC though - is there any way of tracing this? (there's nothing to cfdump, as far as I know?).
Who is Participating?
I see - so the problem is the cfscript block
fyi - you can use GetPageContext().getResponse().sendRedirect('/somepage.cfm'); in a cfscript block to replace a cflocation tag

I googled monkehtweet and see that code displayed by the author is different than what you have - might want to look at this page :
for one this he has:
objMonkehTweet = createObject('component', 'com.coldfumonkeh.monkehTweet').init('username','password');
this is different than what you have!!!  
Gurpreet Singh RandhawaWeb DeveloperCommented:
just make


and removed your cflock and also use meta refresh instead of cflocation toredirect to next page then check what is happening

Also use cfdump after ur query to see if u are getting results or not!
where you have "<CFIF GetUser.RecordCount EQ 1>"
Do you have a recordcount of one on this query?
Check that first!
If you don't then thats your problem - If you do then post back and we can look further ...

One question I do have - is this page visible when you run it?
Meaning is it called using jquery or ajax or in a hidden iframe???
or is it visible just like any other web page?
If its not then you won't see the cflocation work - it will look like it didn't work.

btw - Don't remove your cflock around setting your session vars - that is correct
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

RedBullLeeAuthor Commented:
Thanks for the reply, myselfandhawa.

The problem itself is the CFC - the session element etc is all working fine.  
RedBullLeeAuthor Commented:
Thanks, dgrafx.

Yes, there is just the one record (and the insertion elsewhere prevents there being more than one match).

At the moment, it's a 'visible' page - though I do intend to adapt it to use Ajax in the future (I never do this until its working as it should in a basic form - much easier to debug, usually!).

The cflocation works fine if I put it above the CFC invoke, which again points to an issue with the invoking - I'm just confused at the fact no errors are being returned.
if the invoke is preventing the cflocation there would not be an error unless there is an error - know what i mean?
cflocation is pretty "violent" so try doing a javascript alert just to show it works
then send the user to the other page with jquery function or js method
you will need to eliminate the cflocation anyway once you go to the other method - right!!!
RedBullLeeAuthor Commented:
Yup, I understand what you mean.  The invoke must be failing on something (hence the page not displaying any of my H1 tags beyond that point), but I can't understand why it's not telling me the problem.
if you remove the cflocation - does the code then display?
RedBullLeeAuthor Commented:
No, same thing - it will show content right up to the point of the invoke, but thats all.
RedBullLeeAuthor Commented:
Thanks dgrafx - there are two different implementations of MonkehTweet - the one you mention above is for a single account, the one I'm using is multi-account (authentication is done later).

I think the easiest way forward is going to be for me to try doing this separately, and invoke the cfc elsewhere.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.