Not an easy question--session

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

  1. #1

    Default Not an easy question--session

    hi all,

    I have a search form, and a result page..The result page page shows edit and
    deleted buttons..when i updated or delete one record....after that instead of
    taking me back to the result page...it takes but it page come with all records
    in db..I am locking the form variables but end I am getting an err..Any help
    will be app.

    The result page has this segment:

    <cfparam name="url.up" default="">
    <cfparam name="form" default="">

    <!---Controlling the session--->
    <cfif isdefined("form.FieldNames")>

    <cflock type="readonly" timeout="600" scope="session">

    <cfwddx action="cfml2wddx" input="#form#" output="session.form">

    </cflock>

    <cfelse>

    <cfif isdefined("url.UseSession")>

    <cflock scope="session" type="readonly" timeout="1800">

    <cfwddx action="wddx2cfml" input="#session.form#" output="form">

    </cflock>

    </cfif>

    </cfif>


    The ERROR is:
    ------------------------------------------------------
    Element FORM is undefined in SESSION.


    The error occurred in
    C:\CFusionMX\wwwroot\Denemeler\PhoneBook\SearchPhn Results.cfm: line 19

    17 : <cflock scope="session" type="readonly" timeout="1800">
    18 :
    19 : <cfwddx action="wddx2cfml" input="#session.form#" output="form">
    20 :
    21 : </cflock>

    After deleting or updatating I am forwarting the people back to result page...
    ------------------------
    <cflocation url="SearchPhnResults.cfm?UseSession=2&Up=Record has been
    Updated!!" ADDTOKEN="NO">


    emmim44 Guest

  2. Similar Questions and Discussions

    1. I have an easy question.
      I want to create plan - add a texture to it - create a second plan then add that same original texture to the second plane. When I attempt to add...
    2. Easy question = easy answer?
      Well, so I'm pretty new with Freehand, at the mo running with MX and havin' a problem (not big, but anyway)... I'm creating some cards and they...
    3. Easy PHP question
      Im trying to send a variable via GET to a php script like so: <a href="process.php?id=test & test">Link</a> Leaving spaces is no problem, but...
    4. Easy Question/Easy Answer
      Ok, this is all i want to know how to do, i made a text link, now when someone rolls over it with their pointer i want it to change color. Simple?
    5. very easy question!!!!
      ÇÁ¶óÀÓ½´Áî wrote: I recommend you keep a box of tissues beside your computer when you are coding in PHP.
  3. #2

    Default Re: Not an easy question--session

    Without seeing the rest of the code it is difficult to tell a) what variables
    you are passing, b) what pages you are passing them to, and more importantly,
    c) what is the scope of the variables being passed? A few problems I do notice
    are:

    1. Since you are updating the value of a session variable, you should be using
    an "exclusive" lock, not "readonly".

    ....
    <cfif isdefined("form.FieldNames")>
    <cflock type="readonly" timeout="600" scope="session">
    <cfwddx action="cfml2wddx" input="#form#" output="session.form">
    </cflock>
    ....

    2. The code below doesn't check to see if #session.form# exists.

    <cfif isdefined("url.UseSession")>
    <cflock scope="session" type="readonly" timeout="1800">
    <cfwddx action="wddx2cfml" input="#session.form#" output="form">
    </cflock>
    ....

    If the #session.form# variable was never set, then the code above would
    result in the error

    "Element FORM is undefined in SESSION".

    "The ERROR is:
    ------------------------------------------------------
    Element FORM is undefined in SESSION.

    3. It's really a bad idea to use "FORM" as a variable name. A structure named
    "FORM" is already used by CF. By using the same name as a system structure, you
    can inadvertently overwrite the CF information or you may even end up
    referencing the wrong information, due to the fact that java passes structures
    "by reference". Both issues can be difficult to track down. It is better to
    avoid the problem altogether by using a name other than "FORM"


    mxstu Guest

  4. #3

    Default Re: Not an easy question--session

    Thank you..for the info..I changed the name from form to smth else..And
    ...I figure out that..in coldfusion admin server..I forgot to change the
    session interval..before it was 10 sec..now I realized (after extending time
    time--1 hr)I dont get error..because the variable is still valid

    emmim44 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