ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #31  
Old February 28th, 2008, 06:01 PM
codemonger codemonger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 67 codemonger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 19 m 28 sec
Reputation Power: 1
Quote:
Originally Posted by kiteless
What is the error? I thought you were using cfparam to set a default value for that variable so I'm not sure why you'd be getting an error.


Wait, I was wrong! the part that isn't working properly is this:

<cfif #IsDefined("SESSION.user.firstname")#>
<a href="admin/index.cfm" class="navA">You are logged in</a>
</cfif>

If your logged in and the session isn't ended, this link comes up. Right now it comes up when you log out.

I'm sorry, the rest is working.

Last edited by codemonger : February 28th, 2008 at 06:28 PM.

Reply With Quote
  #32  
Old February 28th, 2008, 07:50 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,475 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 7 m 51 sec
Reputation Power: 42
What about simply:

<cfif session.isValidUser>
You are logged in
</cfif>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #33  
Old February 28th, 2008, 08:04 PM
codemonger codemonger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 67 codemonger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 19 m 28 sec
Reputation Power: 1
Quote:
Originally Posted by kiteless
What about simply:

<cfif session.isValidUser>
You are logged in
</cfif>


That did it! THANK YOU! Was getting sick of looking at this code. I tried using the isValidUser... but left it like this:
#session.isValidUser# silly me left the pund signs on!

Thanks a lot man!

Reply With Quote
  #34  
Old February 28th, 2008, 10:32 PM
codemonger codemonger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 67 codemonger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 19 m 28 sec
Reputation Power: 1
Quote:
Originally Posted by kiteless
What about simply:

<cfif session.isValidUser>
You are logged in
</cfif>


Premature cheers. After dumping my large amount of internet cash, this code is throwing an error. I have been trying to see if I can fix it. Here is the error:

Element ISVALIDUSER is undefined in SESSION.


The error occurred in C:\Websites\4npp8b\sitemanager.cfm: line 125

123 : Login/Password.</b></font>
124 : </cfif>
125 : <cfif IsDefined(session.isValidUser)>
126 : <a href="admin/index.cfm" class="navA">You are logged in</a>
127 : </cfif>

I get this same error with the code you posted, I also tried:

<cfif IsDefined(session.isValidUser)> = The error you see now
<cfif session.isValidUser> = The error you see now
<cfif StructKeyExists(session, 'isValidUser')> = Doesn't work

that is as far as I have gotten right now. Any other ideas?

Sorry, thought it was working

Reply With Quote
  #35  
Old February 29th, 2008, 09:19 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,475 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 7 m 51 sec
Reputation Power: 42
Then something else is wrong somewhere, because isValidUser is set up in the session scope in onSessionStart. Which means it should ALWAYS exist. It might be false, it might be true, but it will always be one or the other. You can try dumping the session scope in various places to confirm whether it is defined or not.

Maybe now you see why I had earlier brought up "programming by coincidence". Even though you've pushed your way through this problem (with my help), I'm not convinced that you actually *understand* everything that is going on here. My perception may be wrong, but it looks like you're throwing code up against the wall to see what sticks and then just going with that.

With my help, we can probably keep banging on this to make it work FOR NOW. But in the long run, I think you'd be better off (not only for maintaining this code but for being a programmer in general) if you take the time to fully understand everything going on in these files, how things interact, and how changes in one piece of code affect the rest of the code.

Reply With Quote
  #36  
Old February 29th, 2008, 09:37 AM
codemonger codemonger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 67 codemonger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 19 m 28 sec
Reputation Power: 1
Quote:
Originally Posted by kiteless
Then something else is wrong somewhere, because isValidUser is set up in the session scope in onSessionStart. Which means it should ALWAYS exist. It might be false, it might be true, but it will always be one or the other. You can try dumping the session scope in various places to confirm whether it is defined or not.

Maybe now you see why I had earlier brought up "programming by coincidence". Even though you've pushed your way through this problem (with my help), I'm not convinced that you actually *understand* everything that is going on here. My perception may be wrong, but it looks like you're throwing code up against the wall to see what sticks and then just going with that.

With my help, we can probably keep banging on this to make it work FOR NOW. But in the long run, I think you'd be better off (not only for maintaining this code but for being a programmer in general) if you take the time to fully understand everything going on in these files, how things interact, and how changes in one piece of code affect the rest of the code.


Yes, I am throwing code up against the wall right now. I admit that. I think it might have been easier to re-write the whole thing at this point for cf8 and not try and make code I wrote 4 yrs ago work. But at this point, this is the last hurdle.

I am self taught with this, So I don't have all the answers. I understand what is going on with the code, but don't know ALL the reasons some things don't work, like this problem.

I was thinking. Could it be something in my main application.cfc file that isn't defining the session?

Reply With Quote
  #37  
Old February 29th, 2008, 11:38 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,475 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 7 m 51 sec
Reputation Power: 42
It shouldn't be, OnSessionStart should run whenever a session is created. But you could try adding a cfparam for session.isValidUser to the section of code where the error is happening, and default it to false.

Don't worry, I am self-taught too. And still learning, after 11 years.

Reply With Quote
  #38  
Old February 29th, 2008, 11:58 AM
codemonger codemonger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 67 codemonger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 19 m 28 sec
Reputation Power: 1
Quote:
Originally Posted by kiteless
It shouldn't be, OnSessionStart should run whenever a session is created. But you could try adding a cfparam for session.isValidUser to the section of code where the error is happening, and default it to false.

Don't worry, I am self-taught too. And still learning, after 11 years.


That did it. Now it's working.
I find I am always learning when it comes to this stuff. That's what I like about it, something different all the time.

Thanks for the help. Much appreciated!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Problem with locking down a directory for log in using cfc


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway