I'm caching a page using CFCACHE, but in order to view the page the user has
to have access. In the application page I have it check if the user is
logged in, if not then I send them to the login page.
Application.cfm
<cfif NOT IsDefined("Session.UserInfo")>
<cfif cgi.PATH_INFO contains "AlertArchive">
<cflocation url="Login/Login.cfm" addtoken="No">
</cfif>
</cfif>
Once they are logged in I set an Array of their information and I put that
into a session.
login.cfm
<CFSET Session.UserInfo = ArrayNew(1)>
<CFSET Session.UserInfo[1] = "#return_db_fields#">
<CFSET Session.UserInfo[2] = "#return_db_fields1#">
<CFSET Session.UserInfo[3] = "#return_db_fields2#">
<CFSET Session.UserInfo[4] = "#qryFnameLnameEmail.FirstName#">
<CFSET Session.UserInfo[5] = "#qryFnameLnameEmail.LastName#">
<CFSET Session.UserInfo[6] = "#qryFnameLnameEmail.Email#">
<CFSET Session.UserInfo[7] = "#qryFnameLnameEmail.Username#">
On the page I am caching, at the top I check to see is session.MyArray[2] is
valid. It seems to be looping back because the session is valid but then
throws an error.
Caching page
<cfif Session.UserInfo[2] LTE "1">
Sorry you don't have access
<cfabort>
</cfif>
That doesn't work! The value of the user I was test was 2, so it I did this
Session.UserInfo[2] LTE "2" it would work (weird).
So then, I created a page that will determine if the the session.MyArray[2]
is defined, if it is I include the cached pages, otherwise I include a page
that displays no access. This doesn't work either, the server just hangs as
if it is still looking. I entered #session.MyArray[2]# with no CFOUTPUT and
did find it diplayed twice.
Page to determine if they have access:
<cfif IsDefined("Session.UserInfo")>
<cfinclude template="Module/Module.cfm">
<cfelse>
<cfinclude template="NoAccess.cfm">
</cfif>
Any idea why this is not working?
All I want to do is have them login, and if they have the correct access
number let them view the cached page.
Thanks,
RM
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.