How to test seesion expired

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default How to test seesion expired

    <cfif IsDefined("Session.accounts_pk") and IsDefined("Session.org_pk")>
    ... some code
    </cfif>

    after seesion expired, above the "if statement" can not block process. and
    coldfusion debugger tell error happens inside cfif block, (undefine seesion
    variable "Session.accounts_pk" )

    Can someone help me? Is that something wrong with fuction Isdefine()?

    Thank you1

    jiecoldfusion Guest

  2. Similar Questions and Discussions

    1. [PHP] Logged Out of Seesion, Then use back button
      Sorry Didier, your suggestion did not solve the problem. I appreciate the information though! I'm still having the "back" button problem in the...
    2. Logged Out of Seesion, Then use back button
      Hello, I've googled to try to find an answer to this. I've also checked the php.net site. Perhaps I'm not using the correct search parameters. ...
    3. Test::Unit -- multiple errors in test method ???
      Hi ! I have been writing some unit tests with Test::Unit. I've noted that when an assertion fails in a test method, the remaining assertions...
    4. Method test::unit::TestSuite#<<(test)
      Hi, I suggest to change the definition of this method slightly: current: # Adds the test to the suite. def <<(test) @tests << test end
    5. The server response was: 550 5.7.1 <test@test.com>... we do not relay
      Your web server is set (as it should be) to not send email from domains it doesn't belong to. That's the "we don not relay" part of the message. ...
  3. #2

    Default Re: How to test seesion expired

    did you try to use ParameterExists(url.module)?

    jorgepino Guest

  4. #3

    Default Re: How to test seesion expired

    ParameterExists doesn't work too!
    jiecoldfusion Guest

  5. #4

    Default Re: How to test seesion expired

    Are you sure there's not something else happening? Try this:

    <cfif IsDefined("Session.accounts_pk") >
    <cfoutput>#Session.accounts_pk#</cfoutput>
    </cfif>

    And see if you still get an error. I've never had any problems with this.


    OldCFer Guest

  6. #5

    Default Re: How to test seesion expired

    I try this before
    (<cfif IsDefined("Session.accounts_pk") >
    <cfoutput>#Session.accounts_pk#</cfoutput>
    </cfif>
    )

    but it always keep saying that accounts_pk is undefine.

    right now I use this for temp solution

    <CFPARAM name="Session.accounts_pk" DEFAULT="FALSE">
    <cfif #Session.accounts_pk# IS "FALSE">
    </cfif>
    So far, it works.

    do you have any idea

    Thank you for the advice,

    Jie


    jiecoldfusion Guest

  7. #6

    Default Re: How to test seesion expired

    If you define your session variables inside Application.cfm using cfparam with
    a default value then you can simply test the variable for that default value to
    see if the session has expired.

    ie. <cfparam name="session.UserID" default="0">

    Assuming session.UserID normally contains a non-zero value, it will reset to
    zero at any point where a page loads and the session has expired..

    cheers.

    efecto747 Guest

  8. #7

    Default Re: How to test seesion expired

    Yes,
    <cfparam name="session.UserID" default="0">

    Assuming session.UserID normally contains a non-zero value, it will reset to
    zero at any point where a page loads and the session has expired..


    above works.

    Thank you!

    jiecoldfusion Guest

Posting Permissions

  • You may not post new threads
  • You may 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