Set Session Variables

Is it possible to set 'OS_USER','TERMINAL' or 'HOST' in 'USERENV' in C#?
This assignment is possible to do as in the example code in java.
Link: https://community.oracle.com/thread/258126

See http://msdn.microsoft.com/en-us/library/96xafkes(v=vs.110).aspx for details
Environment.SetEnvironmentVariable("MyVariable", "MyValue", EnvironmentVariableTarget.User);

Similar Messages

  • Set session variables inside a page

    Inside the page "form.cfm" I have this code:
    <form name="report" action="pagestatistic.cfm"
    method="post">
    <INPUT name=ONE size=15 >
    <INPUT name=TWO size=15 >
    <input type="submit" value="Go ON">
    </form>
    I would like to set session variable: ONE and TWO, inside the
    page: pagestatistic.cfm
    IN that way when I will refresh the page "pagestatistic.cfm"
    I will watch have the same results.
    I added this code at the top of "pagestatistic.cfm" but it
    doesn't work.
    <CFSET session.ONE = #ONE#>
    <CFSET session.TWO = #TWO#>
    Could you tell me what goes wrong?
    Thanks
    CFWork

    quote:
    Originally posted by:
    liquid One
    When you say refresh the page, do you mean submit the form by
    clicking on the submit button? Or are you filling out the input
    boxes and hitting refresh?
    I mean I clicked a link that links the same page:
    pagestatistic.cfm
    Then I would like to add to this link 2 get variables
    pagestatistic.cfm?ColorPage=Green&Order=2 to change the
    background color and the order of the results of the page. That it
    is impossible because when i refresh the page it is doesn't work.
    What do you suggest me to do?
    Thanks,
    CfWork

  • 'In Between' Date Prompt to set Session Variables???

    Hi
    Im very new to OBIEE and was hoping someone could help me. I have a date prompt using the 'in between' operator based on a date column.
    I am trying to set up a table in the Physical layer of the RPD using a stored proc (EXEC sp_name). The stored proc takes 2 input paramaters - a start data and an end date. These dates i would like to come from the in between prompt. I have set up the physical table structure to receive the results of the request.
    I looked at setting a session variable but it is asking me to insert sql to set the value and i dont want to hit the database outside of the stored proc. Also, even if i have session variables i cant see how to set them to the values in the prompt when using the 'In Between' operator.
    Im really very confused and i have been searching the net and the documentation for any clue.
    Any help would be appreciated
    Thanks

    In between operator doesn't support presentation variable..
    so break this into is into two prompts...and use equal to operator, then you can use them as request variables which will in turn override your session variables.
    in the report use operator between and use these variables in the filter..

  • Can I set session variables from inside my Javascript?

    hi all,
    i want to set a couple of session variable while i am inside my javascript.
    can I do that?
    m_asu

    No. JavaScript runs on the client and the session is on the server. You can use JavaScript to set parameters that get passed back in the request and can then be put in the session.

  • Application.cfm - Should I use queries or set session variables?

    Hi,
    I have an application that has many users for many different
    companies logged in at the same time using the system. I use the
    application.cfm to call and set a bunch of variables that make the
    system work, such as preferences and things. Would it be better to
    use 5 or 6 queries all pulling one record, or call the queries only
    once at the start of the session and set 30 to 50 session variables
    based on the query results? Which method would bog the system down
    less? It seems that session variables use quite a bit of memory.
    I'm just trying to get the "simple answer" for this, if that's even
    possible.
    Please let me know your thoughts and experience on this.
    Thanks much,
    Jeff W!

    In order to give you a simple "do it this way" answer, more
    information is needed.
    How long does it take to run those 5-6 queries on each
    request? How many users are logged in at peak times? How much data
    would you be storing in the session for each user? How much RAM do
    you have on your server?
    On one application, we've decided to go the session variable
    route. The size for each users' session maxes out at 2.5 KB. We
    have 512 MB dedicated to CF, but can easily scale up on the
    hardware we have to 1.5 GB or more. At 512 MB, 2.5 KB per user
    session, we can handle a little over 200,000 concurrent users
    (assuming all CF memory could be utilized for session variables,
    which isn't true). There are only 6,000 users total in our system,
    so we have quite a bit of headroom.
    Are you on CF8? If so, open up the server monitor, start
    monitoring, profiling, and memory tracking, and log in with a
    couple users (with your code setup to store all that info in the
    session). See how much storage each session takes. Then look at
    your server. How much RAM do you have? what do you currently have
    allocated to ColdFusion? What's your peak concurrent user level? Do
    you have headroom? Also, see if the benefits of storing it in the
    session are even worth it (how long do those 5-6 queries add to
    each requst?)

  • Set Session Variable

    Hello,
    Anyone know how to set a session variable from data entered within a messageTextInput field from a uix page within a JHeadstart application?
    I tried to trigger an event to write the session but was unsuccessful.
    Any ideas?
    -Jeff

    Jeff,
    We do not support UIX events, because they are part of the UIX Controller. We use the Oracle9iAS MVC Framework (or Struts in next release) as the Controller.
    So, if you want to put a value of a messageTextInput on the session, you need to write a custom process that does this. Note that the MVC Framework provides an abstraction called the InfoTable around the Session object.
    In chapter 2 of the JHeadstart User Guide, section "Writing a Custom Process" you can find more information on reading and writing information from/to the InfoTable.
    Steven Davelaar,
    JHeadstart Team.

  • How to re-set session variables in OCI when a TAF callback  is invoked ?

    Can you show me an example of how to re-set NLS_DATE_FORMAT when the Failover ends ( that is, in OCI_FO_END )? All I see is the template code provided by Oracle to handle TAF event.
    How to register TAF callback function

    You can re-set the variable just like you set it at the beginning of the connection in the switch branch you mentioned.
    Doesn't it work?

  • Setting session variable names based on variables in a loop

    I am trying to set up a loop that sets up a list of variables based upon a list, by looping over the list and setting the session.NAME:
    <CFLOOP list="#fieldnames#" index="fieldname">
    <cfset session.#fieldname# = "1">
    </CFLOOP>
    It does not seem to like session.A_CF_VARIABLE . so session.#fieldname# does not work, I get an error
    A CFML variable name cannot end with a "." character.
    The variable session. ends with a "." character. You must supply an additional structure key or delete the "." character.
    Do I have to wrap it a different way?
    Thanks
    Mark

    ahh. great. that fixed the loop problem. My second problem now appears that I am not picking up the correct data.
    My test data has a form post with field names EMAIL and GENDER, and then I was trying to write session.email = VALUE_OF_FORM_FOR_EMAIL .. session.gender = VALUE_OF_FORM_FOR_GENDER, but what I am actually doing is writing the values EMAIL and GENDER into the session. so session.email has the value EMAIL.. and not what I typed into the form.
    I guess it's because the fieldname in the index is also used as the name in the form and it's confusing it, so it goes for the wrong one, not the value from the form.
    the alternative would be to append something to the name of each field in the form.. so email is F_email and F_gender... although i tried this and using <CFSET session[fieldname] = "F_#fieldname"> but that threw an error, maybe just a formatting issue. I'd prefer to try and make it work without appending anything to the form names
    Here's some test code that has the form fields hard coded -->
    <CFSET fieldnames="email,gender">
    <CFSET email = "[email protected]">
    <CFSET gender = "M">
    <CFLOOP list="#fieldnames#" index="fieldname">
    <cfset session[fieldname] = '#fieldname#'>
    </CFLOOP>
    Thanks once again for the help
    Mark

  • Setting session variables in application context using OpenJPA

    Hi!
    I am using openjpa 1.2 with EJB 3.0. I am connecting to Oracle 11g database and need to use the oracle virtual private database for security and data segregation. For this purpose, I need to set some custom variables at the session level of the application context such as the application user name. Since, I am using container injected EntityManager using @PersistenceContext, I am finding it hard to do so.
    Can anyone please help me out
    Thanks in advance
    Abhi

    You will probably want to ask your question on an OpenJPA forum to see if they even can support VPD (if not, see EclipseLink http://wiki.eclipse.org/Introduction_to_EclipseLink_Sessions_(ELUG)#Isolated_Client_Sessions_and_Oracle_Virtual_Private_Database_.28VPD.29 )
    You might also want to try injecting the factory instead and use that to get the EntityManager instead of injecting the em directly. ie
    @PersistenceUnit(unitName="my-pu")
    private EntityManagerFactory emf;
    Best Regards,
    Chris

  • Can I set a Session Variable from a Dashboard Prompt, using values that are

    Hi All
    Trying to set a Session Variable to an integer value, by letting users select a text value from the drop-down list on a Dashboard Prompt. The goal is to set the input parameter to the IndexCol function, but to provide the end users with a text description of what they are setting.
    Select Value Set Variable Value
    My 0
    My Team 1
    My Companies 2
    My Teams Companies 3
    Any suggestions on how to accomplish this? Certainly we could populate the drop-down from a data source, however I don't see how to populate a variable with something other than the values on the screen.
    The IndexCol function is referenced in a Filter in Answers, and I'm thinking to populate a Session variable using the (Presentation) variable value set from the prompt. But how to do this? I see a reference to a function NQSSetSessionValue(), but cannot find documentation on how it works.
    Any clue will be greatly appreciated.
    Thanks

    Hi kishore..
    Looks like the link u have sent uses advanced SQL tab to set session variables. I want to know if I can use "set variable NQ_SESSION.myvar= @something" in the "SQL results" -while creating a dashboard prompt-.
    Purpose: I want the session variable to be set based on whatever report that im currently in.
    And i dont want to use presentation variables because im using a reset button in my page.
    My reset script resets presentation variables and NOT session variables.
    Thanks in advance
    Loy

  • Code to set and destroy session variables in Java Server Pages(JSP)

    code to set and destroy session variables in Java Server Pages(JSP)
    we have use following statement to set session variable
    session.setAttribute("userClient",id);
    we have use following statement to destroy session variable
    session.setAttribute("userClient","");
    and
    the session.invalidate() is not working
    Plz. solve this probem

    code to set and destroy session variables in Java
    Server Pages(JSP)
    we have use following statement to set session
    variable
    session.setAttribute("userClient",id);
    we have use following statement to destroy session
    variable
    session.setAttribute("userClient","");Perhaps if you tried using
    session.setAttribute("userClient", null);
    or
    session.removeAttribute("userClient");
    and
    the session.invalidate() is not workingNot working how?
    >
    Plz. solve this probem

  • How to pass session variable value with GO URL to override session value

    Hi Gurus,
    We have below requirement.Please help us at the earliest.
    How to pass session variable value with GO URL to override session value. ( It is not working after making changes to authentication xml file session init block creation as explained by oracle (Bug No14372679 : which they claim it is fixed in 1.7 version  Ref No :Bug 14372679 : REQUEST VARIABLE NOT OVERRIDING SESSION VARIABLE RUNNING THRU A GO URL )
    Please provide step by step solution.No vague answers.
    I followed below steps mentioned.
    RPD:
    ****-> Created a session variable called STATUS
    -> Create Session Init block called Init_Status with SQL
        select 'ACTIVE' from dual;
    -> Assigned the session variable STATUS to Init block Init_Status
    authenticationschemas.xml:
    Added
    <RequestVariable source="url" type="informational"
    nameInSource="RE_CODE" biVariableName="NQ_SESSION.STATUS"/>
    Report
    Edit column "Contract Status" and added session variable as
    VALUEOF(NQ_SESSION.STATUS)
    URL:
    http://localhost:9704/analytics/saw.dll?PortalGo&Action=prompt&path=%2Fshared%2FQAV%2FTest_Report_By%20Contract%20Status&RE_CODE='EXPIRED'
    Issue:
    When  I run the URL above with parameter EXPIRED, the report still shows for  ACTIVE only. The URL is not making any difference with report.
    Report is picking the default value from RPD session variable init query.
    could you please let me know if I am missing something.

    Hi,
    Check those links might help you.
    Integrating Oracle OBIEE Content using GO URL
    How to set session variables using url variables | OBIEE Blog
    OBIEE 10G - How to set a request/session variable using the Saw Url (Go/Dashboard) | GerardNico.com (BI, OBIEE, O…
    Thanks,
    Satya

  • GO URL with Session Variable

    I want to use interaction between two reports in different dashboards, which do not share the same tables but the same values.
    When clicking on column A values in Report A, I want to create action link with option to open Report B, presenting column B, which is filtered by value A.
    I also want the prompts in Report B to present the value A, as it was selected by the user on Report A.
    I thought about using GOURL in action link to specific URL. I manage to open Report B, but it is not filtered by A.
    How can I transfer the value A in the URL? how should I add the value A into '&val1=XXX'?
    I also want to transfer other prompt values (e.g. val2 of col2) from A to B. I set this prompt value to session variable, but how can I add it in the GOURL syntax of '&val2=XXX'?

    Hi,
    Check those links might help you.
    Integrating Oracle OBIEE Content using GO URL
    How to set session variables using url variables | OBIEE Blog
    OBIEE 10G - How to set a request/session variable using the Saw Url (Go/Dashboard) | GerardNico.com (BI, OBIEE, O…
    Thanks,
    Satya

  • Purchased ColdFusion 10: Having problem with session variables

    My Dept. has just bought CF10 and I'm finally updating my existing web app to CF10 from CF8. My First Problem with CF10 is using session variables.
    When using the lower version of CF (since CF 4 to 8) I have never had any problem setting up session variables and getting or using these variables in other pages after a successful login but with CF 10 it seems setting session variables and using them in other pages are a major problems. I'm not sure where have I done wrong in the codes.
    First I'm setting the session in my Application.cfc This way:
    <cfcomponent displayname="Application" output="true">
      <cfset THIS.Name ="MyNewApp"/>
      <cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,20,0) />
      <cfset THIS.SessionManagement ="YES"/>
      <cfset THIS.SessionTimeout = CreateTimeSpan( 0, 0, 20, 0 ) />
      <cfset THIS.SetClientCookies = false />
    <cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false">
    <cfset application.Main_DSN = "TESTDB">
    <cfreturn true />
    </cffunction>
    <cffunction name="onApplicationEnd" output="false">
          <cfargument name="applicationScope" required="true">
        </cffunction>
    <cffunction name="OnSessionStart" access="public" returntype="void" output="false" hint="Fires when user session initializes.">
    <cfset session.loggedin = "NO">
    <cfset session.username = "">
    <cfset session.userrights = "">
    <cfset session.usergroup = "">
    </cffunction>
    </cfcomponent>
    After login, user is validated and set values to those session.variables:
    ........user validation codes here......................
    <cfif mylogin NEQ true>
          <cflocation url="/login/login.cfm">
          <cfabort
    <cfelse>
          <cfset session.loggedin="Yes">
          <cfset session.username="#Trim(Form.username)#">
         <CFSET qUserRights = LoginObj.getUserRights('#Trim(Form.username)#')>
         <cfset session.userrights = qUserRights><!--- it's a query --->
        <CFSET qUserGroup = LoginObj.getUserGroup('#Trim(Form.username)#')>
            <cfloop query="qUserGroup">
               <cfset session.usergroup = user_group>
               <cfbreak>
            </cfloop>
        <!--- ****************** ???????????????????????????????????????????????????????????????????????????
        When I do cfdump in at this level, I can see that all of these session variables have been assigned to their values.
        But these session variables are not accessible from other pages. Other pages still show these session variable without its value.
        So, when I use these cfdumps in the index.cfm it is shown as they're not yet assigned with any values   ****************** --->
       <cfdump var="#session.loggedin#">
       <cfdump var="#session.username#">
       <cfdump var="#session.userright#">
       <cfdump var="#session.usergroup#">
    </cfif>
    In index.cfm, Before Login I got:
    session.loggedin = NO
    session.username = ["empty string"]
    session.userrights = ["empty string"]
    session.usergroup = ["empty string"]
    After a successful Login:
    session.loggedin = NO
    session.username = ["empty string"]
    session.userrights = ["empty string"]
    session.usergroup = ["empty string"]
    Have I done something wrong? These codes work on CF8. Please help.
    I need to mentioned:
    CF10 is in Linux and my web app is under https not http. But these session variables should be shared bentween http and https because some older application are still in http.

    On which page is the following code?
    After login, user is validated and set values to those session.variables:
    ........user validation codes here......................
    <cfif mylogin NEQ true>
          <cflocation url="/login/login.cfm">
          <cfabort
    <cfelse>
          <cfset session.loggedin="Yes">
          <cfset session.username="#Trim(Form.username)#">
         <CFSET qUserRights = LoginObj.getUserRights('#Trim(Form.username)#')>
         <cfset session.userrights = qUserRights><!--- it's a query --->
        <CFSET qUserGroup = LoginObj.getUserGroup('#Trim(Form.username)#')>
            <cfloop query="qUserGroup">
               <cfset session.usergroup = user_group>
               <cfbreak>
            </cfloop>
        <!--- ****************** ???????????????????????????????????????????????????????????????????????????
        When I do cfdump in at this level, I can see that all of these session variables have been assigned to their values.
        But these session variables are not accessible from other pages. Other pages still show these session variable without its value.
        So, when I use these cfdumps in the index.cfm it is shown as they're not yet assigned with any values   ****************** --->
       <cfdump var="#session.loggedin#">
       <cfdump var="#session.username#">
       <cfdump var="#session.userright#">
       <cfdump var="#session.usergroup#">
    </cfif>

  • Struts-JSP : how to use session variable?

    Hi,
    i'm new to both struts and JSP and have a doubt here -
    I'm creating a web application in which a user logs in.
    I need to access this user's userid (id name with which he logs in) in my action classes. how can i do this ?
    please help !
    Thanks in advance,
    susen

    // set session variable
    session.setAttribute("value","hello world");
    // retrieve session variable
    HttpSession session = request.getSession(false);
    String variable = (String) session.getAttribute("value");
    variable will have "hello world"
    Edited by: abel on May 12, 2008 4:52 AM

Maybe you are looking for

  • Weird Sound in iMovie

    When i edit/save a movie i see a red line that makes a wierd chirping sound. How do I get rid of it?

  • What is clearing cache for?

    I have an iPad 2. What is the purpose of clearing the cache? What's it for?

  • Nec monitors won't wake up

    I have two NEC PA272W Spectraview monitors connected to a 2013 6 core, MacPro with dual 500 video cards and 64 gigs of memory.  I have tried all the monitor settings to put them to sleep and wake them up.  They will go to sleep in several of the auto

  • Report to Evaluate the Total Cost of Producing a Meterial

    Dear Experts, Is there any report from where I can generate the total cost incurred for producing a material for a given period of time. Please Help Thanks

  • Airport extreme external drive Format?

    I have an airport extreme and would like to set up either one or both external drives 2tb and 3tb as media drives or storage. I have a combination of Imac, Ipad, PCs and Android devices that connect and I would like to have the abilty to read/ write