Session variable

I created a period status session variable which i want to use as a filter in answers. This variable takes note of the last closed period (month - YYYYMDD) when the accounting team closes it in their books. I currently have open periods taking the values of the last closed period and so the client wants these open periods to be removed from the report until the period in closed with accounting hence the use of a filter on the period (month) column. I used this filter eg Time."Fiscal Period" <=  VALUEOF(NQ_SESSION."CURR_PER_OPEN") but it is producing this message:
The specified criteria didn't result in any data. This is often caused by applying filters that are too restrictive or that contain incorrect values. Please check your Request Filters and try again. The filters currently being applied are shown below.

Hi,
Try it like this..
Set the default using logical SQL. Select <presentation table>.<presentation
column> from <subject area> where
<presentation table>.<presentationation column> =
valueof(NQ_SESSION.<session variable>)
http://gerardnico.com/wiki/dat/obiee/set_request_variable_dashboard_prompt
http://sureshotstrategies.blogspot.com/2008/07/about-session-variables-in-obiee.html
Thanks
Deva

Similar Messages

  • To pass new session variable value to stored proc before running a report.

    Hi,
    Below is summary of the report requirement -
    Database level design
    1. Created a view and a global temporary table (GTT)
    2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
    Repository level design
    1. Created a business model containing the view and the GTT (mentioned above)
    2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
    Query for these variables :
    from_dt = select from_date from <table>
    to_dt = select add_months(from_date,12) from <table>
    Presentation level design
    1. Using a text box, i display the default/initialized values of these variables like this -
    Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
    Dates get displayed in YYYY-MM-DD 00:00:00 format
    The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
    2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
    i select Calender Controls for both; setting Default To = Report Defaults.
    The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
    3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
    SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
    Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
    If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
    If the user does not specify different date range, then the default/initialized dates must be considered.
    I also display the default and new date values in the report title.
    Back to Repository level design
    To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
    DECLARE
    v_from_dt date;
    v_to_dt date;
    BEGIN
    v_from_dt := VALUEOF(From_Dt);
    v_to_dt := VALUEOF(To_Dt);
    package_name1.package_body(v_from_dt,v_to_dt);
    END;
    Now when i try to run the report i get the following error :
    [nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
    Need help on this.
    Is it possible to "write back" a new value to a session variable ?
    Any other alternatives.
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 24, 2011 10:08 PM

    Sandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
    *10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
    It's not a BI error. This error are generated by Oracle DB. If I write next:
    SELECT MyPLSQLFunction(p1,p2) FROM DUAL
    I get the same error.
    Oracle doesn't allow DML operations in SELECT.
    Did you relalize this feature yourself? Where did I mistake?

  • Session variable size limitation (LV Webservices)

    Hi community,
    I read couple dozen email addresses from an XML and trying to write them into a session variable. The email addresses are comma separated and have a total string length of about 1100 characters. When I try to write it into a session variable LabVIEW drops an error message (-67158).
    It is very clearly related to the size of the string as if use lets say only 200 characters I dont receive the error message.
    How can I get rid of this limitation?
    Thanks!

    I am writing a general purpose webpage where I need email notifications. I have the workaround ready (before I send out the emails I dont read the emails from a session, but using the userID stored in the session to read the email from the xml). But generally having this limitation is annoying and unnecessary as normally you easily can store 100kB in one session. (probably even more, but that was the max I have ever did)

  • Trying to move a list of form variables to session variables of the same name

    I am trying to move a list of form variables to session variables of the same name and I am having a lot of trouble.
    I have never had to post of this forum with a language question in all the 10 years I have been using ColdFusion. I was a qa Engineer @ Allaire/Macromedia back when it was going from one to the other. I have a pretty good grasp of the language.
    I have software that runs off a list. The fieldnames are variable and stored off in an array. It's survey software that runs off a "meta file". In this example; I have the number of fields in the survey set to 12 in the "metafile". I have each field declared in that file in array Session.SurveyField[1] and the above loop works fine. I include this "metafile" at the start of the process.
    I cfloop around a struct and it works wherever I have needed to use it; such as here - writing to the database for example;
    <CFQUERY NAME="InsertRec" DATASOURCE="Survey">
    INSERT into #variables.SurveyTableName#
    (EntryTime
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    ,#Session.SurveyField[arrayindex]#
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,q01_name,q02_AcadTechORNA,q03_Water,q04_FirstAid,q05_CPR,q06_LifeGuard,q07_AED
    ,q08_ProjAdv,q09_Color,q10_SantaClaus,q11_Supervisor,q12_SupervisorOpinion --->
       VALUES
        ('#EntryTime#'
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thisname = "Session." & Session.SurveyField[arrayindex]>
    ,'#evaluate(variables.thisname)#'
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,'#Session.q01_name#','#Session.q02_AcadTechORNA#','#Session.q03_Water#','#Session.q04_Fi rstAid#'
    ,'#Session.q05_CPR#','#Session.q06_LifeGuard#','#Session.q07_AED#','#Session.q08_ProjAdv# ',
    ,'#Session.q09_Color#','#Session.q10_SantaClaus#','#Session.q11_Supervisor#','#Session.q1 2_SupervisorOpinion#' --->
    </CFQUERY>
    NOW HERE'S THE PROBLEM: I am running into trouble when trying to move the form variables to session variables of the same name. It is the only part of the software that I still need the datanames hard coded and that is a roadblock for me.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thissessionfield = "Session." & Session.SurveyField[arrayindex]>
    <cfset thisformfield = "Form." & Session.SurveyField[arrayindex]>
    <cfset #thissessionfield# = #evaluate(thisformfield)#>
    </cfloop>
    I have tried it with or without the "evaluate"; same result. It doesn't give an error; it just ignores them (session variables look as such in the next page in the chain)
    q01_name=
    q02_acadtechorna=
    q03_water=
    q04_firstaid=
    q05_cpr=
    q06_lifeguard=
    q07_aed=
    q08_projadv=
    q09_color=
    q10_santaclaus=
    q11_supervisor=
    q12_supervisoropinion=
    Note: they exist because I CFPARAM them in a loop like the above at the start of the procedure) - and this works just fine!
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset dataname = "Session." & Session.SurveyField[arrayindex]>
    <cfparam name="#variables.dataname#" default="">
    </cfloop>
    </cflock>
    I EVEN tried exploiting the Form.Fieldnames list using CFLoop over the list and the same sort of logic within and it still gives me nothing....
    Here's the FORM.FIELDNAMES value
    "Q01_NAME,Q02_ACADTECHORNA,Q03_WATER,Q04_FIRSTAID,Q05_CPR,Q06_LIFEGUARD,Q07_AED,Q08_PROJAD V,Q09_COLOR,
    Q10_SANTACLAUS,Q11_SUPERVISOR,Q12_SUPERVISOROPINION"
    Here's the logic; SAME RESULT - The session variables don't get set.
    <cfoutput>
    <cfloop list="#Form.FieldNames#" index="thisfield">
    <!--- <br>#thisfield# --->
    <cfscript>
    thisSESSIONfield = "Session." & thisfield;
    thisFORMfield = "Form." & thisfield;
    #thisSESSIONfield# = #thisFORMfield#;
    </cfscript>
    </cfloop>
    </cfoutput>
    The CFPARAM in a loop with variable output name works just fine; so does the post (which I included above) as does the SQL Create, Param Form Variables, Param Session Variables, etc.
    THIS even works for moving BLANK to each session variable, to zero them all out at the end of the process;
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    </cfscript>
    <cfset #thissessionfield# = "">
    </cfloop>
    </cflock>
    Expanding on that code, you would think this would work, but it doesn't;
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    thisformfield = "Form." & thislocalfield;
    </cfscript>
    <!--- debug --->
    <!--- <cfoutput>#thissessionfield# = "#evaluate(thisformfield)#"</cfoutput><br> --->
    <cfoutput>
    <cfset #thissessionfield# = "#evaluate(thisformfield)#">
    </cfoutput>
    </cfloop>
    And see that debug code in the middle? To add insult to injury... When I uncomment that it shows me this. So it certainly looks like this should work....
    Session.q01_name = "Me"
    Session.q02_AcadTechORNA = "N/A"
    Session.q03_Water = "Yes (certificate expired)"
    Session.q04_FirstAid = "Yes (certificate is current)"
    Session.q05_CPR = "No"
    Session.q06_LifeGuard = "Yes (certificate expired)"
    Session.q07_AED = "Yes (certificate expired)"
    Session.q08_ProjAdv = "Yes (certificate expired)"
    Session.q09_Color = "Gray"
    Session.q10_SantaClaus = "Yes"
    Session.q11_Supervisor = "Da Boss"
    Session.q12_SupervisorOpinion = "Not a bad thing"
    There must be some simpler way to do this. This way won't work against all odds even though it seems so much like it should.
    So I end up having to hardcode it; still looking for an automated way to set these #@%$*@!## session variables over the list from the form variables of the same @#@!$#%$%# name. Do I sound frustrated???
    No matter what I do, if I don't HARDCODE like this;
    <cfset Session.q01_name = Form.q01_name>
    <cfset Session.q02_AcadTechORNA = Form.q02_AcadTechORNA>
    <cfset Session.q03_Water = Form.q03_Water>
    <cfset Session.q04_FirstAid = Form.q04_FirstAid>
    <cfset Session.q05_CPR = Form.q05_CPR>
    <cfset Session.q06_LifeGuard = Form.q06_LifeGuard>
    <cfset Session.q07_AED = Form.q07_AED>
    <cfset Session.q08_ProjAdv = Form.q08_ProjAdv>
    <cfset Session.q09_Color = Form.q09_Color>
    <cfset Session.q10_SantaClaus = Form.q10_SantaClaus>
    <cfset Session.q11_Supervisor = Form.q11_Supervisor>
    <cfset Session.q12_SupervisorOpinion = Form.q12_SupervisorOpinion>
    I always get this from my next page because the session variables are empty;
    You must answer question 1.
    You must answer question 2.
    You must answer question 3.
    You must answer question 4.
    You must answer question 5.
    You must answer question 6.
    You must answer question 7.
    You must answer question 8.
    You must answer question 9.
    You must answer question 10.
    I tried duplicate as well, but I can not get the above to work...
    Can anyone help me do this thing that one would think is simple????

    I think if you use structure array syntax you should get the results you want.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
          <cfset session[Session.SurveyField[arrayindex]] = Form[Session.SurveyField[arrayindex]]>
    </cfloop>
    Or probably even easier.
    <cfset session = duplicate(form)>

  • Can we use session variables in BI publisher's Data Model SQL Query?

    Hi Experts,
    We need to implement Data level security in BI Publisher 11g.
    In OBIEE we do so by using session variables, so just wanted to ask if we can use the same session variables in BI Publisher as well
    ie can we include the where clause in the Data Models SQL Query like
    Where ORG_ID = @{biServer.variables['NQ_SESSION.INV_ORG']}
    Let me know your views on this.
    PS: We are implementing EBS r12 security in BI Publisher.
    Thanks

    Read this -> OBIEE 11g: Error: "[nQSError: 23006] The session variable, NQ_SESSION.LAN_INT, has no value definition." when Creating a SQL Query using the session variable NQ_SESSION.LAN_INT in BI Publisher [ID 1511676.1]
    Follow the ER - BUG:13607750 - NEED TO BE ABLE TO SET A SESSION VARIABLE IN OBIEE AND USE IT IN BI PUBLISHER
    HTH,
    SVS

  • Compare data record to session variable

    I am completely stumped. It should be easy.
    I am trying to compare a field from a database to a sesssion variable on a JSP page and even though the fields print out the same when I call them in JSP, my "If" statement never gets activated.
    Here's the last version of the code I tried:
    String usernamev = UserSession.getValue("username").toString();
    String custname = RS.getString("ORCUST");
    if (usernamev.equals(custname))
    userrole="Customer ";
    I've also tried this:
    String usernamev = UserSession.getValue("username").toString();
    String custname = RS.getString("ORCUST").toString;
    if (usernamev.equals(custname))
    userrole="Customer ";
    And I've also tried this:
    if (RS.getString("ORCUST").equals(usernamev))
    userrole= "Customer ";
    And This:
    And I've also tried this:
    if (usernamev.equals(RS.getString("ORCUST")))
    userrole= "Customer ";
    When RILLI is the field I'm trying to compare this works:
    if (usernamev.equals("RILLI"))
    userrole= "Customer ";
    Somehow my data type must be wrong but I can't figure out why. When I print out
    <%=usernamev%>
    and <%=RS.getString("ORCUST")%>
    they show on my webpage as RILLI. I can also assign a constant value to userrole without a problem.
    What the heck am I doing wrong?

    I think limeybrit was on the right track and I hadn't trimmed because I got a no trim method error before because I hadn't converted session variable to a string.
    When I used this:
    String usernamev = UserSession.getValue("username").toString();
    usernamev = usernamev.trim();
    String custname = RS.getString("ORCUST").trim();
    I think its working now. Thanks for help all.

  • Session variable getting reset when leaving dashboard

    I have created a session variable with the 'Enable any user to set the value' option.  I'm using the session variable as the default for a dashboard prompt.  I'm able to set the variable with that  dasboard prompt, and I can confirm that it is indeed getting set properly.  So the interaction of the variable and the prompt seems to be in order.
    After I make a selection from the dashboard prompt, as long as I stay in the dashboard, the session variable stays set to my selection.  I can move from page to page and everything is fine.  The selection stays put as I have set it.  However, the moment I leave the dashboard, the session variable is reinitialized back to its default value as specified by the SQL in its initialization block.  I can go from dashboard to catalog and back to dashboard - boom, it's back to the default.  My selection has been replaced.  ???
    And here's an odd thing:  I can look in the query log and see the initialization block code getting run when I log in.  So far, so good.  I can run the dashboard, make a prompt selection, and see the query log updated just fine.  Still OK.  BUT... when I switch from dashboard to catalog and back to dashboard, the value of the session variable is reset (I see the default month in my analysis and as the prompt default upon redisplay of the dashboard page), but there's no indication in the query log that the initialization block SQL ran again.  The last SQL in the query log still shows my "selected" value in the SQL.  The dashboard page is showing the "default", while the last entry in the query log shows the "selected".
    Can anyone else confirm this odd behavior?  And is there a reason that a session variable should not retain its value throughout the session?  I've always viewed session variables as little buckets of single-cell data whose contents are consistent and static for the duration of a session, unless manually changed by a dashboard prompt.  If the behavior that I'm seeing is both replicatable and expected, it would appear that my understanding is flawed.
    Running 11.1.1.7.0 on Windows Server 2008.  Same behavior is occurring in both Firefox 21 and IE 9.

    Thank you for your answer MK,
    I try to write a SQL in my prompt but not work for me:
    -In default selection I choose SQL Results and I type: Year(Current_date) and save my prompt and I don't see any value in my dashboardpage, if I click in prompt I can see all members of my year dimension but by default is empty.
    I modify the other solution: I have 1hour refresh time and I change for 1 minute, but doesn't work.
    the default initializer is in RPD (variable year that belongs to BI_Year Block) and I have written 2009.

  • Urgent help required...for replacing JSP session variables

    I am trying to enhance the performance of a j2ee based webapp which use session variables to store the data...
    Is there any alternative for session variables..The project is based on j2ee-Struts frame work..But the amount of code maintainance should be minimum ....so i can't create beanforms for all these data...
    Is there any XML based methods available...??

    ok... thanks... i created a fla file and inthe action script
    pasted the following code
    var nc:NetConnection = new NetConnection();
    nc.connect("rtmp://flash.ispstream.com/ondemand/unikron/my_video_dj/");
    var ns:NetStream = new NetStream(nc);
    contentMain.myVideo.attachVideo(ns);
    ns.setBufferTime(5);
    ns.play("dvd_r");
    nothing is working if i tried to load... can u help me out

  • Passing attribute value in session variable

    Hi All
    I need to store one field value from my SIM form as a session variable and pass them to the next page along with my session, using some jscript stuff or else. Does this make sense?
    If it is possible or anyone have any prior experience please reply.
    Thanks in advance

    We have tested a code-snippet that 'gets' attribute-values from the session:
    <invoke name='getAttribute'>
        <invoke name='getHttpSession'>
            <ref>:display.state</ref>
        </invoke>
        <s>attribute_name</s>
    </invoke>You can try 'setAttribute' in the similar way.
    Thanks,
    Adi

  • Javacard and session variables

    Hello,
    I'm trying to find a reasonable Javacard technique to handle "session variables" that must be kept between successive APDUs, but must be re-initialized on each card reset (and/or each time the application is selected); e.g. currently selected file, currently selected record, current session key, has the user PIN been verified...
    Such variables are best held in RAM, since changing permanent (EEPROM or Flash) variables is so slow (and in the long run limiting the operational life of the card).
    Examples in the Java Card Kit 2.2.2 (e.g. JavaPurseCrypto.java) manipulate session variables in the following way:
    1) The programmers group session variables of basic type (Short, Byte, Boolean) according to type, and map each such variable at an explicit index of a vector (one per basic type used as session variable).
    2) At install() time, each such vector, and each vector session variable, is explicitly allocated as a transient object, and this object is stored in a field of the application (in permanent memory), where it remains across resets.
    3) Each use of a session variable of basic type is explicitly translated by the programmer into using the appropriately numbered element of the appropriate vector.
    4) Vector session variables require no further syntactic juggling, but eat up an object descriptor worth of permanent data memory (EEPROM or Flash), and a function call + object affectation worth of applet-storage memory (EEPROM, Flash or ROM).
    The preparatory phase goes:
    public class MyApp extends Applet  {
    // transientShorts array indices
        final static byte       TN_IX = 0;
        final static byte       NEW_BALANCE_IX=(byte)TN_IX+1;
        final static byte      CURRENT_BALANCE_IX=(byte)NEW_BALANCE_IX+1;
        final static byte      AMOUNT_IX=(byte)CURRENT_BALANCE_IX+1;
        final static byte   TRANSACTION_TYPE_IX=(byte)AMOUNT_IX+1;
        final static byte     SELECTED_FILE_IX=(byte)TRANSACTION_TYPE_IX+1;
        final static byte   NUM_TRANSIENT_SHORTS=(byte)SELECTED_FILE_IX+1;
    // transientBools array indices
        final static byte       TRANSACTION_INITIALIZED=0;
        final static byte       UPDATE_INITIALIZED=(byte)TRANSACTION_INITIALIZED+1;
        final static byte   NUM_TRANSIENT_BOOLS=(byte)UPDATE_INITIALIZED+1;
    // remanent variables holding reference for transient variables
        private short[]     transientShorts;
        private boolean[]   transientBools;
        private byte[]      CAD_ID_array;
        private byte[]      byteArray8;  // Signature work array
    // install method
        public static void install( byte[] bArray, short bOffset, byte bLength ) {
             //Create transient objects.
            transientShorts = JCSystem.makeTransientShortArray( NUM_TRANSIENT_SHORTS,
                JCSystem.CLEAR_ON_DESELECT);
            transientBools = JCSystem.makeTransientBooleanArray( NUM_TRANSIENT_BOOLS,
                JCSystem.CLEAR_ON_DESELECT);
            CAD_ID_array = JCSystem.makeTransientByteArray( (short)4,
                JCSystem.CLEAR_ON_DESELECT);
            byteArray8 = JCSystem.makeTransientByteArray( (short)8,
                JCSystem.CLEAR_ON_DESELECT);
    (..)and when it's time for usage, things go:
        if (transientShorts[SELECTED_FILE_IX] == (short)0)
            transientShorts[SELECTED_FILE_IX] == fid;
        transientBools[UPDATE_INITIALIZED] =
            sig.verify(MAC_buffer, (short)0, (short)10,
                byteArray8, START, SIGNATURE_LENGTH);I find this
    a) Verbose and complex.
    b) Error-prone: there is nothing to prevent the accidental use of transientShorts[UPDATE_INITIALIZED].
    c) Wastefull of memory: each use of a basic-type state variable wastes some code; each vector state variable wastes an object-descriptor worth of permanent data memory, and code for its allocation.
    d) Slow at runtime: each use of a "session variable", especially of a basic type, goes thru method invocation(s) which end up painfully slow (at least on some cards), to the point that for repeated uses, one often attain a nice speedup by caching a session variable, and/or transientShorts and the like, into local variables.
    As an aside, I don't get if the true allocation of RAM occurs at install time (implying non-selected applications eat up RAM), or at application selection (implying hidden extra overhead).
    I dream of an equivalent for the C idiom "struct of state variables". Are these issues discussed, in a Sun manual, or elsewhere? Is there a better way?
    Other desperate questions: does a C compiler that output Javacard bytecode make sense/exists? Or a usable Javacard bytecode assembler?
    Francois Grieu

    Interesting post.
    I don't have a solution to your problem, but caching the session variables arrays in local variable arrays is a good start. This should be only done when the applet is in context, e.g. selected or accessed through the shareable interface. This values should be written back to EEPROM at e.g. deselect or some other important point of time. Do you run into problems if a tear happens? I don't think so since the session variables should be transactional, and a defined point will commit a transaction.
    Analyzing the bytecode is a good idea. I know of a view in JCOP Tools (Eclipse plugin) where you can analyze the bytecode and optimize it to your needs.

  • Using Session Variables for User Login - sometimes they don't persist... what am I doing wrong?

    Hi all,
    I'm running a site that requires user login.  I approached the building of this site as almost a complete newb to CF (and dynamic coding in general), and it's been a great learing experience (with lots of help from you guys).
    However, I guess I never learned the correct way to handle a user login.  It seemed to me that I could just test the user-entered credentials against those stored in a database, then set a session variable containg that user's record number.  Then, not only would I have an easy way of knowing who this user was and therefore what info to serve him, but I could test for the existence of a valid login on every page in the protected folder, by adding this code to my application.cfc in that folder:
    <cfset This.Sessionmanagement=true>
    <cfset This.Sessiontimeout="#createtimespan(0,8,0,0)#">
       <cfif NOT isDefined ("session.username") or NOT isDefined ("session.password") or NOT isDefined ("session.storeID")>
         <cflocation url="../index.cfm" addtoken="no">
       </cfif>
    ...and it goes on to run a query and verify that the session.username and session.password match for the store defined by session.storeID.  If not, all session variables are cleared and it bounces you back to the login page.  When the user clicks Logout, all I do is delete all the session variables.
    This seemed to work great for like a year, but lately I've been getting reports that the login doesn't seem to persist for longer than approx. 20 minutes of inactivity.  You can see I specified session variables to remain active for 8 hours (I know that seems like a drastically long login, but it's what's necessary for this application).  I've only gotten this report from a few people, and I myself can't seem to duplicate it... I've tested an inactive login for 45 minutes now and it held.
    SO:  any reason you can think of why session variables would be spontaneously clearing for some people?  Would having your router reset its IP address invalidate the session or something?  Also, the problem seemed to begin appearing after my host upgraded all their servers to CF9... could there be any relation?
    And on a more general note... did I go about this completely the wrong way to begin with?  If so, what's the standard way to manage a login?
    Lots of questions, I know... thanks very much for any answers or suggestions!
    Joe

    Ian,
    Thanks very much - very helpful information.
    Sounds like passing the tokens in every request is probably the way to go for this.  I don't think it's likely that any users will be sharing links, unless they actually intend for the recipient to see their info anyway.
    Is that all I would have to do, is add the tokens to every path?  Would that guarantee that all the session variables would remain valid until timeout or being cleared?
    Again, thanks, you've been really helpful.
    Joe
    On Jun 23, 2010 4:37 PM, Ian Skinner &lt;[email protected]&gt; wrote:
    Unfortunately this is the nature of HTTP web applications.  There is NO state maintained from HTTP request to request.  This is by design in the HTTP protocol specifications.
    ColdFusion provides two methods to circumvent this limitation.  Each method has limitations and caveats.  They both rely on the passing of tokens between the client and the server with every request.  These tokens can be passed as cookies OR URL (GET) variables.  You are using the cookie method, which is the simpler and most common. You may be experiencing the limitation of this method.  If something happens to the cookies the session can be lost.
    You could pass the (CFID &amp; CFTOKEN) OR JESSIONID tokens through the URL query string with every request.  This requires one to add these values to every link, form action, cflocation or other request path in our application.  ColdFusion provides the session.urltoken variable to make this easier to do.  The tokens will be visible to the user.  Also if the links with an individual token is share with other users, via e-mail, chat, social networks, etc and one of these users utilize the link during the life of a session (8 hours apparently in your case).  Then that user will access the session of the original user.
    Cookie session management is by far the most common choice by CF developers.  If these methods do not meet your needs you would need to go beyond the HTTP limitations of web applications.  One might be able to accomplish this with a Flex|Air|Flash applications that can be configured to use a continuous connection to the server.  Thus not suffer the stateless nature of the normal HTTP request-response cycle.
    I do not know if a router resetting would cause cookies to be discarded or otherwise invalidated.  But I would not think it is beyond the relm of possibilities.

  • Session variable and initialization block issues

    We are using OBIEE 10.1.3.3 and utilizes built in security features. (No LDAP or other single sign on). The user or group names are not stored in any external table. I have a need to supplement Group info of the user to the usage tracking we implemented recently as the NQ_LOGIN_GROUP.RESP column contains username instead of group name. So I created a session variable and associated with a new initialization block and also had a junk default value set to the variable. In the initialization block, I wrote the following query and as a result it inserted correct values into the table when the TEST button was clicked from the initialization block form.
    insert into stra_login_data (username, groupname, login_time) values ('VALUEOF(NQ_SESSION.USER)', 'VALUEOF(NQ_SESSION.GROUP)', SYSDATE)
    My intention is to make this execute whenever any user logs on. The nqserver.log reports the following error and it doesn?t insert values into the table.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.USER, has no value definition.
    [nQSError: 13011] Query for Initialization Block 'SET_USER_LOGIN_BLOCK' has failed.
    [nQSError: 23006] The session variable, NQ_SESSION.GROUP, has no value definition.
    When I changed the insert statement as below, this does get populated whenever someone logs in. But I need the values of GROUP associated with the user as defined in the repository.
    insert into stra_login_data (username, groupname, login_time) values ('TEST_USER', TEST_GROUP', SYSDATE)
    Could someone help me out! As I mentioned above, I need the GROUP info into the usage tracking. So, if there is another successful approach, could you please share?
    Thank you
    Amin

    Hi Amin,
    See [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3376946&#3376946]. You can't use the GROUP session variable in an Init Block unless it has been seeded from an Init Block first. There isn't an easy solution for what you want, but here are some options:
    1) Create a copy of your User => Groups assignments in your RPD in an table so you can use it in your Usage Tracking Subject Area. But this means you will have to replicate the changes in two places so it's not a good solution.
    2) As the GROUP session variable is populated when you login you could theoretically use it a Dashboard and pass it a parameter to write the value to the database. But as I am not sure how can you make fire only once when the user logins it sounds like a bad idea.
    3) Move your User => Groups assignments from your RPD to a DB table. Use OBIEE Write Back or something like Oracle APEX to maintain them.
    I think 3) is the best solution to be honest.

  • Session Variable in filter view error

    Hello,
    My prompt is defaulted to current 12Weeks. I used session variable in the prompt to capture 12 Weeks (Current Week and Current+12).
    so the default value is @{biServer.variables['NQ_SESSION.PERIOD_STDATE']} where PERIOD_STDATE is my session varible.
    I am using a filter view to display the filters being applied.
    When the user opens a tab, the filter view is throwing error
    ***The syntax of the expression to be evaluated is invalid.***
    ***Expression: @{biServer.variables['NQ_SESSION.PERIOD_STDATE']}***
    My report is running fine. I just have the date column as prompted in my report request.
    When the user hits go button on the prompt then the filter view comes up just fine.
    What is that I am doing wrong? Why does the filter view gives result after hitting GO button?
    Please help.
    thanks,
    deep

    Hi,
    1. Set the default using logical SQL. Select <presentation table>.<presentation column> from <subject area> where <presentation table>.<presentationation column> =valueof(NQ_SESSION.<session variable>)
    2. You dont have to write the exact syntax for entering the session variable in the default values. You just need to use the session variable name after selecting the session variable type in the drop down.
    Hope this helped/ answered.
    Regards
    MuRam

  • Session variable causing ADODB.Field error '800a0bcd'

    i have a page that before the session variable was added,
    would display the
    text i required if the recordset was empty.
    Now i have a session variable on the same page and if the
    recordset is
    empty, instead of showing the text i need displayed, i get
    the following
    error:
    ADODB.Field error '800a0bcd'
    Either BOF or EOF is True, or the current record has been
    deleted. Requested
    operation requires a current record.
    /Help_Desk/verified.asp, line 31
    If i remove the session variable code from the page, it works
    fine.....why
    the conflicts?
    <%Session("last")
    =(rsVerify.Fields.Item("c_last_name").Value)%>
    <%Session("first")
    =(rsVerify.Fields.Item("c_first_name").Value)%>
    <html>
    What im doing is verifying if a user exists in the database.
    If they do
    there name is stored in a session and used later on the
    following pages. If
    they do not exist, they are suppose to receive a message
    indicating to call
    our support center to update there name...
    I dont understand why the addition of the above two lines
    cause this error

    Here is all the code on the page... please let me know if
    there is something
    incorrect.....
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="../Connections/USD.asp" -->
    <%
    Dim rsVerify__varLname
    rsVerify__varLname = "%"
    If (Request.Querystring("last") <> "") Then
    rsVerify__varLname = Request.Querystring("last")
    End If
    %>
    <%
    Dim rsVerify__varFname
    rsVerify__varFname = "%"
    If (Request.Querystring("first") <> "") Then
    rsVerify__varFname = Request.Querystring("first")
    End If
    %>
    <%
    Dim rsVerify
    Dim rsVerify_numRows
    Set rsVerify = Server.CreateObject("ADODB.Recordset")
    rsVerify.ActiveConnection = MM_USD_STRING
    rsVerify.Source = "SELECT c_last_name, c_first_name,
    c_middle_name,
    c_email_addr FROM AHD.ctct WHERE c_last_name = '" +
    Replace(rsVerify__varLname, "'", "''") + "' and c_first_name
    = '" +
    Replace(rsVerify__varFname, "'", "''") + "' and del = '0'"
    rsVerify.CursorType = 0
    rsVerify.CursorLocation = 2
    rsVerify.LockType = 1
    rsVerify.Open()
    rsVerify_numRows = 0
    %>
    <%Session("last")
    =(rsVerify.Fields.Item("c_last_name").Value)%>
    <%Session("first")
    =(rsVerify.Fields.Item("c_first_name").Value)%>
    <html>
    <head>
    <title>Account Verification</title>
    </head>
    <body text="#000000" link="#0000FF" vlink="#0000FF"
    alink="#0000FF"
    leftmargin="0" topmargin="0">
    <!--#include virtual="/inc/header.asp" -->
    <br>
    <br>
    <% If Not rsVerify.EOF Or Not rsVerify.BOF Then %>
    <table width="605" align="center">
    <tr bgcolor="#9999FF">
    <td><strong>USD Name:</strong></td>
    <td><strong><%=(rsVerify.Fields.Item("c_last_name").Value)%>,
    <%=(rsVerify.Fields.Item("c_first_name").Value)%></strong></td>
    </tr>
    <tr>
    <td><strong>First
    Name:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_first_name").Value)%></font></strong></td>
    </tr>
    <tr>
    <td><strong>Last Name:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_last_name").Value)%></font></strong></td>
    </tr>
    <tr>
    <td><strong>Email:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_email_addr").Value)%></font></strong></td>
    </tr>
    <tr>
    <td><strong>Location:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_middle_name").Value)%></font></strong></td>
    </tr>
    <tr>
    <td colspan="2"><div
    align="center"><strong>If all 4 fields above
    contain
    your correct information please select from the links
    below.<br>
    If your are missing any information above please contact the
    help
    desk
    before proceeding.</strong> </div></td>
    </tr>
    <tr>
    <td colspan="2"><hr size="1"> <table
    width="400" align="center">
    <tr>
    <td><div align="center"><strong><a
    href="/Help_Desk/usd_stores1.asp">Open
    Store / DC
    Request</a></strong></div></td>
    <td><div align="center"><strong><a
    href="/Help_Desk/usd_corp1.asp">Open
    Corporate
    Request</a></strong></div></td>
    </tr>
    </table></td>
    </tr>
    </table>
    <% End If ' end Not rsVerify.EOF Or NOT rsVerify.BOF %>
    <br>
    <div align="center">
    <% If rsVerify.EOF And rsVerify.BOF Then %>
    <table width="605">
    <tr>
    <td><div align="center"><font
    color="#FF0000"><strong>If you are
    receiving
    this message, chances are you are not completely setup in
    USD.<br>
    Please contact the help desk to have your information
    verified and
    setup
    if needed.</strong></font>
    </div></td>
    </tr>
    </table>
    <% End If ' end rsVerify.EOF And rsVerify.BOF %>
    </div>
    <div align="center"></div>
    <!--#include virtual="/inc/footer.asp" -->
    </body>
    </html>
    <%
    rsVerify.Close()
    Set rsVerify = Nothing
    %>
    "Daniel" <[email protected]> wrote in message
    news:[email protected]...
    >i have a page that before the session variable was added,
    would display the
    >text i required if the recordset was empty.
    >
    > Now i have a session variable on the same page and if
    the recordset is
    > empty, instead of showing the text i need displayed, i
    get the following
    > error:
    >
    > --------------------------
    > ADODB.Field error '800a0bcd'
    > Either BOF or EOF is True, or the current record has
    been deleted.
    > Requested operation requires a current record.
    >
    > /Help_Desk/verified.asp, line 31
    > -----------------------------
    >
    > If i remove the session variable code from the page, it
    works fine.....why
    > the conflicts?
    >
    > <%Session("last")
    =(rsVerify.Fields.Item("c_last_name").Value)%>
    > <%Session("first")
    =(rsVerify.Fields.Item("c_first_name").Value)%>
    > <html>
    >
    > --------------
    >
    > What im doing is verifying if a user exists in the
    database. If they do
    > there name is stored in a session and used later on the
    following pages.
    > If they do not exist, they are suppose to receive a
    message indicating to
    > call our support center to update there name...
    >
    > I dont understand why the addition of the above two
    lines cause this error
    >
    >

  • Session Variable? -How do I treat this

    Hello,
    I am writing an application that is tracking the results
    arriving from various selected stations (230 of them). My
    application will dynamically displays only stations for which
    results have been received. I plan to have my page refresh every 5
    minutes to update the results list.
    Now based on results received I will update a report page, so
    I need to set a variable that changes every time my query result
    set changes and then I will pass this new value to the report page
    for processing. I am confused about how to treat this variable.
    Should I use set it as a cookie or a session variable? (but it
    could change many times during the session)? TIA

    Hi,
    Your questions is not clear, so I'm not sure if this is what
    you are looking for.
    Let's forget for a moment how the data gets there, and let's
    focus on the report.
    You have a databases that get's constantly updated with
    new/changing records. It's sounds to me like you need to timestamp
    your data, and when the report page is opened, you need to
    aggregate data from now()-5 minutes to now() and display them.
    The refresh for the page every 5 minutes needs to be done
    with javascript (window.setTimeout)
    cheers,
    fober

Maybe you are looking for

  • Space requirements for Time Machine?

    Greetings, I have recently bought an iMac (last week) and awaiting my update to Leopard. One of the novelties that interests me most about Leopard is the Time Machine, but I was wondering how much disk space it would require on my external drive. I k

  • I just got a New Mac pro--wanted to partition..DVD install disc says error.

    I just got the new mac out of the box...Partitioned it and installed software. DVD 1 worked good..when it asked for dvd 2...it says error. I cleaned the DVD and tried it again. Same problem. I put it in my power mac to see if it would read it..and it

  • Installing .csf files and using them to create a pdf from Indesign.

    I have a .csf file that was sent to me that I need to: 1.     Install (not sure how to do that in CS4), 2.     And be able to use in Indesign when I create a pdf from an Indesign file. I'm not sure how to do this.

  • Blocking Vendor to create PO if any PO is exist for the same vendor

    Dear All, My scenario is , I want to restrict user to create PO for any vendor if for the same vendor PO is already available or not yet closed . System should allow user to create PO if previous PO are closed. How to solve this issue. Any user exit

  • Implementing an IGraphicsPort of my own [CS2 & CS3]

    I'm trying to implement my own graphics port so that I can draw some arbitrary page items and process the rendering methods for my own uses.<br /><br />I've implemented a GraphicsPort like this<br />>class FixupGraphicsPort : public CPMUnknown<IGraph