On a similar topic to ongoing discussions...

I have a few different areas of my site that I only want registered
users to have access to.

1) I set up a session.allowed variable in my Application.cfm (defaulted
to 0) if the variable isn't already present. Code:

<!--- set the default that a user has not been logged in --->
<cfif not isdefined("session.allowed")>
<cflock name="setAllowed" timeout="5">
<cfset session.allowed = 0>
</cflock>
</cfif>

2) I set up switches in the necessary pages to show a login include if
the session.allowed var equalled 0. Code:

<cfif session.allowed eq 0>
<login:form actionpage="reservation.cfm">
<cfelse>
What's Here?
</cfif>

3) I set up my check so that, if login was successful, the
session.allowed var is set to 1. Code:

<cflock name="setAllowed" timeout="5">
<cfset session.allowed = 1>
</cflock>

After a user logs in I see, using debugging, that the var is now set to
1. But, when I go to another page (within the site), I see that the var
is reset to 0. This shouldn't happen as the code in the App only sets to
0 if the var doesn't exist in the first place (see item 1 above for
code). Anyone have any ideas?

Cutter
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to