Professional Web Applications Themes

Auto Logout Based on Session Timeout - Coldfusion - Advanced Techniques

Has anyone created a function that will automatically logout an idle user when the session timeout has been reached? Within the new Application framework of CF7 I would think this would be easy, but I can't figure it out. My bank website sends me to a new page that allows me to reinitialize my session or continue with a logout. - this would be ideal....

  1. #1

    Default Auto Logout Based on Session Timeout

    Has anyone created a function that will automatically logout an idle user when
    the session timeout has been reached? Within the new Application framework of
    CF7 I would think this would be easy, but I can't figure it out. My bank
    website sends me to a new page that allows me to reinitialize my session or
    continue with a logout. - this would be ideal.

    walker25419 Guest

  2. #2

    Default Re: Auto Logout Based on Session Timeout

    >... Has anyone created a function that will automatically logout an idle user 

    You will achieve that simply by enabling session management and giving the
    sessiontimeout attribute a non-zero value using the function,
    CreateTimeSpan().

    BKBK Guest

  3. #3

    Default Re: Auto Logout Based on Session Timeout

    That's what I thought however, both on CF 6.1 and 7, if the user is idle all I get is a session is invalid error. No redirect back to the login page and the user has to close the browser and reopen.
    walker25419 Guest

  4. #4

    Default Re: Auto Logout Based on Session Timeout

    >... CF 6.1 and 7, if the user is idle all I get is a session is invalid error.
    That is, of course, to be expected. Once the session times out, the cabbie
    dies;
    there's no longer anyone to carry user to login page.
     
    I wonder whether the following is possible. I've never tried it before, but it
    seems
    plausible. Do the redirect in the OnSessionEnd method of Application.cfc.

    BKBK Guest

  5. #5

    Default Re: Auto Logout Based on Session Timeout

    What you could do is this - add code on each page so that when the session
    variable does not exist, redirect to the login page using cflocation. Add the
    URL of the page (with all the other variables that are required by that page)
    as a name value pair so that the user can be returned there (with all the
    variables required for the user to continue from there).

    Hope this help.

    Ajit

    Ajit Guest

Similar Threads

  1. Session Management Logout...
    By cmschofield in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: June 17th, 04:41 AM
  2. Session Management Logout...
    By margo_ann in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: June 16th, 11:34 PM
  3. Auto session timeout
    By Tan Ai Leen in forum PHP Development
    Replies: 6
    Last Post: July 21st, 10:00 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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139