|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
Quote:
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. |
|
#32
|
|||
|
|||
|
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 |
|
#33
|
|||
|
|||
|
Quote:
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! ![]() |
|
#34
|
|||
|
|||
|
Quote:
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 |
|
#35
|
|||
|
|||
|
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. |
|
#36
|
|||
|
|||
|
Quote:
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? |
|
#37
|
|||
|
|||
|
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. |
|
#38
|
|||
|
|||
|
Quote:
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! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Problem with locking down a directory for log in using cfc |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|