Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Managgin sessions

Guest
Mar 20, 2008 Mar 20, 2008
My application will let everybody to see the initial page but i need user verification and validation with a login screen to go on into the application.
I've created a screen and login for the whole application but how can I handle both with user validation and without it?
I have index.cfm (the one that hides some links) and if the user logs in then he will see those links.

Any ideas? or examples? thanks
TOPICS
Getting started
473
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 20, 2008 Mar 20, 2008
You may try to check the following sample.

http://tutorial355.easycfm.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2008 Mar 23, 2008
Suppose you log users in using the formula

<cflogin>
<cfloginuser>
</cflogin>

Suppose also that, in your Application file, you enabled session management and set loginStorage to Sessions. Then, throughout the user's session, the functions getAuthUser() and isUserInRole("role_name") will return values that match, respectively, the name and roles attributes of the cfloginuser tag. You could then implement the following kinds of filter on any page:

<cfif Len(getAuthUser()) NEQ 0>
<!--- code/functionality that requires that user be logged in --->
</cfif>

<cfif getAuthUser() is "Jack">
<!--- code/functionality meant for Jack --->
</cfif>

<cfif Len(getAuthUser()) NEQ 0 and isUserInRole("admin")>
<!--- code/functionality meant for admin users. Assumes that roles
attribute of cfloginuser tag has value that includes admin, for example,
"admin" or "admin,user". --->
</cfif>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 23, 2008 Mar 23, 2008
Ok I see what I can do with that, but my problem starts when I am trying to configure the APPLICATION.cfm, how to handle sessions so that can be used managing the aaplication.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2008 Mar 23, 2008
Hi,

After your successful login please keep the login information in the session and validate that the login user has the permission to view the link
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2008 Mar 24, 2008
LATEST
Ayuso_15 wrote:
how to handle sessions so that can be used managing the aaplication.

To use cflogin as above, it is sufficient to do the following.

1) Enable the use of Application and Session variables in the Coldfusion Administrator;
2) Verify that the cfapplication tag in Application.cfm is something like
<cfapplication name = "your_App_name"
applicationTimeout = "#createTimespan(1,0,0,0)#"
sessionManagement = "yes"
sessionTimeout = "#createTimeSpan(0,0,20,0)#"
setClientCookies = "true"
loginstorage="Session">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources