If they successfully log in then you need to set the SESSION variable accordingly. HTH [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Stressed_Simon [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 6 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> SELECT * FROM users WHERE Username = '#FORM.Username#' AND Password = '#FORM.Password#' [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Stressed_Simon [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 8 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> staying logged in...... - Macromedia ColdFusion

staying logged in...... - Macromedia ColdFusion

hi, I used to use .asp and had a login section on a site, when somebody logged in and they surfed the admin section I had a session variable MM_username so that each page knows they are still logged in. How do I do this with CF7? it used to be a simple tab on server behaviours but I now don't know how to do this? any help please or point me to a tutorial? thanks alot...

  1. #1

    Default staying logged in......

    hi, I used to use .asp and had a login section on a site, when somebody logged
    in and they surfed the admin section I had a session variable MM_username so
    that each page knows they are still logged in. How do I do this with CF7? it
    used to be a simple tab on server behaviours but I now don't know how to do
    this? any help please or point me to a tutorial?

    thanks alot

    Simonbullen Guest

  2. #2

    Default Re: staying logged in......

    Hi

    Create session variable like this:
    <cfset session.MM_username=#name#>

    and in each page this will accessble, because we are storing it in the
    session.
    to work session you need to enable the session in your applicattion.cfm/.cfc.


    [url]http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Application[/url]
    s_with_CFML/sharedVars5.htm

    vkunirs Guest

  3. #3

    Default Re: staying logged in......

    thanks for the quick reply, so where does the <cfset session.MM_username=#name#> go? and do I need to apply that to each page I want restricted?

    thanks again

    Simonbullen Guest

  4. #4

    Default Re: staying logged in......

    Hi

    have checked the link which i have given.

    1. Step enable the session in the application.
    2. In the login page if the user enters the corect pwd then assign the
    username into some session variable.
    3. write a page which wil check for the existence of the session variable.
    4. Include the session checking page in each page so that you dont require to
    check the session variable in the each page.
    5. if the session vr\ariable is not exist then redirect it to the login page,
    write this code in the session variable page itself.


    vkunirs Guest

  5. #5

    Default Re: staying logged in......

    i'm sorry for being a bit thick, but i still don't quite understand what I need
    to do. I understand what variables etc but can't see what i physically need to
    do to get my application working the way i want :

    I have application.cfm with session management enabled. I have several pages
    as part of that application including login.cfm.

    I would like to restrict the access to all pages (so use the restrict access
    server bahviour), then, if somebody is logged in I need the application to know
    that so that they can go from page to page within the application until the end
    of that session, when they will need to login again. so what text/behaviour
    etc do I need to put in the application.cfm file and also in each page I want
    them to be able to access once logged in??

    please help!

    thank you very much!!

    Simonbullen Guest

  6. #6

    Default Re: staying logged in......

    In your Application.cfm use cfparam to set the user as logged out by default,
    like so.

    <cfparam name="SESSION.IsLoggedIn" default="False" />

    To lock down all pages add this to your Application.cfm

    <cfif NOT SESSION.IsLoggedIn>
    <!--- This user is not logged in, so force them to log in --->
    <cfinclude template="login.cfm">
    <cfabort>
    </cfif>

    If they successfully log in then you need to set the SESSION variable
    accordingly.

    <cfset SESSION.IsLoggedIn = True>

    HTH

    Stressed_Simon Guest

  7. #7

    Default Re: staying logged in......

    thanks for the reply to my somewhat desperate plea!

    sorry what do you mean "If they successfully log in then you need to set the
    SESSION variable accordingly.

    <cfset SESSION.IsLoggedIn = True>"

    how do I do that??? where do I set that?

    Simonbullen Guest

  8. #8

    Default Re: staying logged in......

    For someone to be logged in, it would logically follow that they need to log
    in?????????????

    OK, with most Web Based Applications this is normally achived by giving a
    Username and Password. Now I am assuming that is what you are doing on
    login.cfm.

    So if their username and password check out against your record then set the
    SESSION variable as I stated.

    You can do it something like this:-

    <!--- check username and password --->
    <cfquery name="qLoginCheck" datasource="myDSN">
    SELECT *
    FROM users
    WHERE Username = '#FORM.Username#'
    AND Password = '#FORM.Password#'
    </cfquery>

    <!--- check to see if they are OK --->
    <cfif qLoginCheck.RecordCount IS 1>
    <cfset SESSION.IsLoggedIn = True>
    <cfelse>
    <!--- do whatever you want to do about people who fail --->
    </cfif>


    Stressed_Simon Guest

  9. #9

    Default Re: staying logged in......

    thanks,

    atfer all of that it seems to work just by adding the "restrict access to page" server bahaviour to each page in the admin section.

    derrrrrrrr.

    :o
    Simonbullen Guest

Similar Threads

  1. P7 MM2 Popups not staying open in IE7
    By WebleyWest in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: October 22nd, 09:00 PM
  2. Drafts not staying Saved!
    By StephSam in forum Macromedia Contribute Connection Administrtion
    Replies: 0
    Last Post: October 14th, 01:35 PM
  3. Converting to B&W.. and staying there.
    By Joshua_Wachs@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 3
    Last Post: April 26th, 07:45 PM
  4. Customers ARE staying with IBM Informix
    By WW Informix Marketing in forum Informix
    Replies: 4
    Last Post: September 23rd, 11:10 AM
  5. Behaviors and pop-up position not staying
    By mark haynes in forum Macromedia Fireworks
    Replies: 0
    Last Post: July 8th, 02:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •