We have an internal page that we use to control things on our website. It's sort of like a home-brewed CMS, but it doesn't hold actual content. It just stores details about the pages (page title, contact person, date created, etc) and allows us to show newly added items on a "what's new" page.
To get into the thing, I have a list of authorized users in a database. I compare this list to a function that the server gives us called GetAuthUser()
I basically do a query to find that username in the database and pull out the associated rights, then assign them to session variables. This worked perfectly in CF8, but not in CF10.
Here's the code that worked before:
<cfquery name="session.userdata" datasource="mydsn">
SELECT usernm, user_email, admin
WHERE usernm = '#listlast(GetAuthUser(),"\")#'
<cfif session.userdata.recordcount eq 0>
<cflocation url="noaccess.html" addtoken="no">
<cfset session.rights = session.userdata.admin>
<cfset session.email = session.userdata.user_email>
Any ideas why it blows up in CF10? I get the dreaded "Element RIGHTS is undefined in SESSION." deal.
Ok, it turns out that my problem was that the old session had not expired, and it probably didn't help that I had a crashed copy of Firefox in the background. Once the old session cleared, everything suddenly worked.
Now on to the next error, which is with cfdirectory. Wish me luck!
What issue are you experiencing with CFDIRECTORY?
The fact that our CMS and the development server are now on totally different machines.
It's been a while since I tried to browse directories on another system. I think CFFTP might be able to do it.
YUP!! As long as the credentials are good, you can use CFFTP to browse directories on another machine.
Ideally, yes, but I think that you have to have CF running under a user account to do that, and we don't. I think as the system account, you don't have rights to do a remote read.
CFFTP has user and password attributes that should log on to any proper FTP user account.
I'm gonna try to get the CMS moved to the machine where the files live before I start digging in too deep. Fingers crossed!
Well as it turns out, my problem is not solved. I logged back in this morning and the session amnesia is back. I just don't get why I can't keep a session in CF10.
Setting this.setClientCookies = true seems to have fixed this.
For today at least. As for tomorrow, who knows?