Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Coldfusion Login Code Fails - No error

Posted on 2010-11-30
11
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 16

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
Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

 

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
 

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 2000 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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

730 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