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
Solved

Coldfusion Login Code Fails - No error

Posted on 2010-11-30
11
281 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 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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