Solved

Coldfusion Login Code Fails - No error

Posted on 2010-11-30
11
279 Views
Last Modified: 2012-05-10
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?).
0
Comment
Question by:RedBullLee
  • 5
  • 5
11 Comments
 
LVL 15

Expert Comment

by:Gurpreet Singh Randhawa
ID: 34247718
just make

query.recordcount>

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!
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 34247834
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
0
 

Author Comment

by:RedBullLee
ID: 34247846
Thanks for the reply, myselfandhawa.

The problem itself is the CFC - the session element etc is all working fine.  
0
 

Author Comment

by:RedBullLee
ID: 34247881
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.
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 34247964
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!!!
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:RedBullLee
ID: 34248024
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.
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 34248054
if you remove the cflocation - does the code then display?
0
 

Author Comment

by:RedBullLee
ID: 34248089
No, same thing - it will show content right up to the point of the invoke, but thats all.
0
 
LVL 25

Accepted Solution

by:
dgrafx earned 500 total points
ID: 34248156
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 : http://www.mattgifford.co.uk/monkehtweets-coldfusion-twitter-cfc/
for one this he has:
objMonkehTweet = createObject('component', 'com.coldfumonkeh.monkehTweet').init('username','password');
this is different than what you have!!!  
0
 

Author Comment

by:RedBullLee
ID: 34248174
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.
0
 
LVL 25

Expert Comment

by:dgrafx
ID: 34248194
ok
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now