Web session variables in Begin_SQL

Is it possible to access web session variables using @variable (or any other means) from within a Begin_SQL?  In particular, we want the end-user's IP address (not the IP address of the BO server).

Magesh,
Are you using OC4J ? In OC4J, by default http sessions are store in memory and not in DB and you cannot use pl/sql to cleanup the sessions.
You can set the session timeout parameter in the web.xml to cleanup sessions.
regards
Debu

Similar Messages

  • Printing a Web Report Using Firefox Results in Lost Session Variables

    Post Author: AVXFlyer
    CA Forum: .NET
    I'm  having a problem with Firefox users printing a Crystal Report from a web site. 
    The first page of the web site collects information to be used in the report generation, for example, start date, end date, type of report etc.  These are all various text boxes, drop down lists, radio buttons and check boxes.  When the user clicks to show the report, everything works fine and the first page of the report will display. The code behind this page takes care of saving al the session variables into hidden fields on the page so the settings will be accessible when the user clicks to view the next page of the report.
    On clicking to view the next page of the report, everything is still fine and the process works beautifully and I've had no problems. 
    A new problem has surfaced during the printing of these reports.  Users who use IE6.0 or IE 7.0 do not have a problem, however, users who use Firefox do have a problem.
    It seems that the print dialog which appears as part of the the Crystal web control manages to 'lose" the variables which were present on the calling page.  It only does this with the Firefox browser.  Calls on postback to retrieve the variables from the hidden fields result in 0's or empty strings ("").
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init .... ....  If Me.IsPostBack = False Then ... ...        strDiscontinuedOnly = Request.Form.Item("ddlInvStatus")             If strDiscontinuedOnly = Nothing Then                 isDiscontinuedOnly = False             Else                 Select Case strDiscontinuedOnly                     Case 0 'All Inventory                         isDiscontinuedOnly = False                     Case 1 'Discontinued Inventory                         isDiscontinuedOnly = True                     Case 2 'Active Inventory                         isDiscontinuedOnly = False                 End Select             End If Else 'Postback is true             intRequestedReport = Request.Form.Item("fldReportID")             strDiscontinuedOnly = Request.Form.Item("fldInvDiscItemsOnly")             isDiscontinuedOnly = Request.Form.Item("fldInvDiscItemsOnly") ... ... end if

    Can't explain it, but here are a few tests;
    1) Try to print a saved data report
    2) Try to print a report that is not using parameters
    3) Try a different printer driver as "default"
    4) Enable the option "Dissociate Formatting Page Size and Printer Paper Size" on the report
    5) What format do you export to?
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Retain variable values across web templates during a web session

    Hi all,
    How can we let web template get variable values from another template's variable values so as to keep the same entry values as previous report run?
    For example 0vendor has a variable (for single, mandory) used in all  vendor related web templates. "vendor1" was entered for the second template.
    I tried to use "SET/GET PARAMETER" in variable user exit. It works in BI with RSRT,  but it doesn't work with Bex or Web template. Looks like web session is not sync with the ABAP stack.
    How about using cookie? How to create/reset cookie in variable user exit? Can we get variable values from web server memory or user session data?
    Please share your thought !
    Thanks for helping!
    David

    Hi Arun,
    All the web templates are randomly run by user, there are no set of templates run after one template. Any templates can run after any other web template.
    Basically we link  web templates with portal menu items. any report can be run by any sequence. The thing the new report need to take the previous selection values from common variables.

  • Loosing session variables in tom cat web app

    Hi,
    I have a very strange problem. I keep loosing session state when I open a JSP from another one.
    The funny part is that it only happens when I access my application from outside my LAN. when I test my application from a client located inside my LAN I have no problems. It raeds session variables with no problems. When I teste t from outside my LAN where the server is located it looses my session variables. i acts as if it has timed out.
    Can you help me with this? The Tom Cat version I`m using is 4.1.27 and the JDK is 1.3.1.
    Many thanks,
    Rui Silva

    travis is right. You should make sure you always pass all your URLs through the String response.encodeURL(String) method. Some users may not be able to accept cookies, others may intentionally turn them off. If you want you app to work in all cases, then your URLs need to be encoded.
    This counts for URLs as part of links, form actions, javascript submissions, etc...

  • 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.

  • Placing session variable on bottom of each printed page

    I have an application that contains a page in which we use as
    a printed report. We plan to convert this someday to a crystal
    report but for now are only option is to use the web browser as our
    reporting page.
    What I need is to know is if there is a way to code the page
    so that the report id, which is stored as a session variable can be
    printed out on either the top or bottom of each new page. The
    report contains a lot of narrative, so it is impossible to tell
    where the new page is going to begin and end because the length of
    the narrative varies from 1 to 10 pages.
    I don’t know if there is anyway to incorporate the page
    setup from the browser settings, we are a state government, and we
    are only using Internet Explorer 6.0 as our browser. The
    application is using CF MX 7.
    Any ideas??
    Thanks.

    I think I misunderstood. You have one long report and when
    printed will be multiple pages. You need the report name to be on
    each page.
    Three ways I can think of to do it.
    First you can use the <title></title> to your
    advantage. When printing from a browser the title is at the top of
    each page. (though this can be turned off under browser options but
    is on by default if I remember correctly).
    <head>
    <cfset report_name = "Dynamic Report Name">
    <title><cfoutput>#report_name#</cfoutput></title>
    </head>
    Second, you can make the report name part of the URL so it
    will appear at the bottom of each page.(this can be turned off too
    in browsers)
    www.mysite.com/reports/rpt_gen.cfm?REPORT_NAME=AGENT_MULDER_EXPENSE_REPORT_2005
    Third, use an image as a watermark. You should probably make
    the image 1/2 the height of the printed page. The background image
    repeats. That way, you are sure it will appear somewhere on each
    page printed. Width is another problem. But you may be able to
    center the background image horizontally using css.
    <body BACKGROUND="images/report_proof_background.jpg" >
    * You might also want to check out using css with page
    breaks.

  • Page Specific Persistence using Session Variables

    Hi, I have read a lot about using session variables to persist the ReportDocument object across page loads.  This works fine if you have just one page open with one report.  The problem I am having is I have a web application that makes 30 or 40 different reports available to the user.  To simplify the code and make it easier to add new reports I have developed a single template aspx page that can be used to view any of the reports.
    My problem is that if the user opens 2 different reports in 2 separate tabs in the browser then the session variable persistence doesn't work because the session variable is available to both tabs.
    Is there a way to persist the ReportDocument object which is 'page' specific.
    Thanks

    Your best option is likely to have something that makes the session variable names unique.  I've done such things as putting the current datetime in the url as a querystring parameter and appending that to the variable name.  On each postback that querystring should persist.
    You might be able to use the reportclientdocument object and serialize the report and persist through view state, haven't tried this with inproc ras though.  A sample that uses the ras sdk can be found [here|http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]

  • Session variables dropping

    I've been having this problem for a long time so I thought
    I'd post again and maybe get a hit this time.
    We run off windows cfmx 7.x now fully patched, prior to that
    we were on cfmx 6.x. We use session management only. Many times on
    a new page hit the user loses about half of their session variables
    up to all of them. Typically we have them test on the same machine
    using different browsers. 99% of the time switching from IE to
    firefox solves the problem, most of the users have had IE 6.x.
    I experienced this problem myself for about 4 months time and
    I could reproduce it daily when neccessary by simply opening a new
    window to our application and the session information would persist
    to the new window but the parent window would receive a new cfid
    and lose all session information. New windows aren't the only
    issue, we see a lot of lost session variables in one click, same
    window, functionality. I've had hooks in place to test if the
    domain was different on page hits removing the www or something but
    so far have not found anything there. Each time a new CFID is being
    issued and they are losing the original. We attempted to put CFID's
    in the URL at all times but that leads to other issues and didn't
    solve the problem for us anyhow.
    This has been a serious issue for awhile and browsing these
    forums I see others are experiencing it to some extent too. I'm
    wondiner if anyone has any tips or can confirm the CF Admin/app.cfc
    setup you use if you're not seeing any problems like this.

    right... response.sendRedirect(). sendRedirect works by sending a repsonse to the browser with a location header. The browser sees that header and makes a new, separate request to the new location. It's no different then typing the location in the location bar in the browser or clicking a link.
    But that doesn't matter. If you have 2 web applications (aka 2 servlet contexts) on the server, they are not going to share sessions between them. So the first page is working off one session in one context with some ID. Then the redirect sends it to another page in a different context. That session ID is not valid in that 2nd context, so a new session is created like it was a first time user. And if you redirect back, you may not get the same session for the first context, unless the session ID cookie defines the path as well (I'm not sure offhand).
    The "application" object is the servlet context, specifically a javax.servlet.ServletContext object (or implementation of the interface, technically). Nothing is shared between contexts.
    Now, you can always share things in one way or another. Store things in a database or in files. Use a messaging system like SOAP or JMS. Maybe the server allows for contexts to access each other (they aren't shared in that case, just that you can get a named context and read what's stored in it).
    Or don't have your separate contexts, use subdirectories in the same context.

  • Session variables being lost in IE7

    has anyone else experienced, heard of, or solved this issue?
    I have a web app thats been running fine for 5+ years and using session variables (i'm currently using CF8).
    When a user goes from page to page the session is carried with them so i know their login info. However, recently some users (and not all) have complained that after logging in fine (meaning the sessions variables are created) and go to another page off of the main one only to get a timeout issue. I've compared everything from IE settings to server settings, etc. but found no differences. It's like once they navigate to another page in the app the sessions are not carried to the next page.
    My timeout code is written so that if the session variables that are created at login are not present the message will show.
    Some users had to revert back to IE6 and it worked fine. Is there something they did wrong with ther IE update or is there some sort of server hot fix for this?
    Hope someone can help... i'm baffled.

    That forum you posted is definitely my issue! However it still is unresolved and the users have yet to pinpoint the cause (just like me). I too firmly believe its due to an IE7 upgrade b/c that is when this happens.
    I've checked out the user cookies. I used this script and put it on my server and had the user try it:
    http://www.bennadel.com/blog/730-Testing-ColdFusion-Session-Cookie-Acceptance.htm
    The cookies are passing over to the next pages fine (this script showed a success on the user machines). But ye the sessions are lost in my app. the CFID and CFTOKEN are changing when the user clicks to go to another page after login.
    In fact I have the CF8 server monitor up and running and when someone logs in I can see the their session info under the MEMORY USAGE --> Sessions by memory usage.
    I'm finding that users with this issue can log in fine but the session never gets registered with the server?!? Their CFID and CFTOKEN is not showing as an active session and when they click to another page their CFID is always different than their original?
    Any thoughts?

  • CFLOGIN not maintaining cfauthrization session variable

    I have a simple CF web site where all of the .cfm is in the
    same directory. I can not use client cookies as the people I am
    writing this for have cookies turned off in IE, therefore I am
    using J2EE session variables and CFLOGIN in an application.cfm file
    (code attached) for authentication. Everything works correctly
    during login and I can see the encrypted username/password as the
    cfauthorization session variable....
    Session Variables:
    cfauthorization=Y3BkYWRtaW46cmVwb3J0ODQzOmNwZA==
    sessionid=c23059df643c42544069
    urltoken=CFID=783&CFTOKEN=91556252&jsessionid=c23059df643c42544069
    Once I try to browse to another cfm page on the site, I get
    booted back to the index.cfm login page. After some digging I
    figure out that the cfauthorization variable was blank after I
    click on the link, which as I understand it indicates that I am not
    logged in and the
    <cfif not IsDefined("cflogin")>
    <cfinclude template="index.cfm">
    <cfabort>
    code in the application.cfm sends me back to the login page.
    I have confirmed that using valid credentials causes <cfif
    cpdauth.recordcount GT "0"> to return true.
    Any idea as to why my session authorization is not being
    maintained between pages? Or if I am completely off base as to the
    reason this is happening.....and if so, what am I doing wrong.
    Thanks
    Greg

    Your login code seems to be fine. You yourself are already
    aware that you have to have a way to pass-the-baton between
    requests, to maintain a session.
    The usual way Coldfusion maintains sessions is to send CFID
    and CFTOKEN cookies to the client browser. That happens
    automatically under the hood, assuming you haven't switched
    setClientCookies off.
    For session management by means of cookies, I would use a
    cfapplication tag like
    <cfapplication name = "cpd"
    applicationTimeout = "#createTimespan(1,0,0,0)#"
    sessionManagement = "yes"
    clientManagement = "yes"
    sessionTimeout = "#createTimeSpan(0,0,20,0)#"
    setClientCookies = "true"
    scriptprotect="all"
    loginstorage="Session">
    However, all of that assumes that the client browser accepts
    cookies. Where it doesn't, the usual way to maintain sessions is to
    pass CFID and CFTOKEN values in the URL of every request. In fact,
    the function that Bluetone suggests,
    URLSessionFormat,
    makes the process efficient. It instructs Coldfusion to append CFID
    and CFTOKEN to the URL only when the client doesn't accept cookies.
    Which means Coldfusion would still be using cookies wherever
    possible. Some examples
    <a href="#URLSessionFormat('orders.cfm')#">My
    orders</a>
    <cfform method="Post"
    action="#URLSessionFormat("MyActionPage.cfm")#">
    </cfform>
    <cflocation url = "products.cfm" addToken = "yes">

  • Session variable is lost

    I have developed a system and it had been used for 6 month
    already, it started had problem last week, user can log in system ,
    but after they click the each menu tab, the system give message
    "please login system" because the session variable is lost.
    I tried to debug the file and find that the session.userID is
    there in the file where I set it, but it become empty in other
    page.
    The weird thing is that it did not happen to everyone, most
    of user don't have problem, only a few user login and the session
    variable is lost after they move from login page to different page,
    when I did cfdump to output all session varibale, I found that
    seesionid changed from page to page for those user who had problem,
    the user who had problem now did not had problem before and I did
    not change any code, I tried the internet setting which still did
    not fix problem.
    I am wondering whether it is related to cold fusion server
    setting.
    Please give some advice.

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
    The helpers at that forum are more knowledgeable about web development issues.<br />
    You need to register at the mozillaZine forum site in order to post at that forum.<br />
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Unable to fetch session variables in my application page code behind

    hi,
    my env:  1  WFE  server which hosts the  central admin and my web appln,  1 sql server box  
    i am having a custom web part[ listviewbyquery web part]  which populates the site collection/ sub site's document library contents . also it reads some query string values and pushes these  values into  session variables.
    and i am having another application page in this application which reads this session variables and  perform some operation in a custom sql db. But i am unable to read these session variables on page load of this  application page.
    am unable to debug also. so, would like to know is there any way i can see, what values  are getting passed to this page and verify the session variables are accessed correctly.
    or
    is this  by design, that its not possible to read session variables in the application page ?
    if i am not having a visual studio env. to debug, how to test these  session variable  existence / to find the root cause of this issue.
    note: already configured session state in IIS , http  modules section. am using Page.Session["myvariable1"].tostring() to fetch the  session variables.
    help is appreciated!

    i have found out myself. i have put  page.response.write(mysessionvariables) in the code and deployed and tested in my env. and i was able to find out the reason and i have fixed it with proper validation check.

  • Session Variables Randomly  Lost between Pages

    My web page uses a session to keep track of who logged in.
    What I noticed is that the session variables stored appears and
    disappears randomly on different pages. The wierd thing is that my
    code is very simple.
    For the life of me I can not figure this out....

    I go through a hosting company and do not expect them to do
    any load balancing.
    What are sticky sessions?
    The cflocation tag also has the addtoken="yes" to it now and
    symptoms persist.
    I tested the case with
    sessiontimeout=#CreateTimeSpan(0,2,0,0)# instead of the
    sessiontimeout=#CreateTimeSpan(0,0,120,0)# and symptoms still
    persist.
    Any other suggestions? I think I ran into a wall
    here....

  • Inablility to retrieve values of session variables in irpt page

    We currently are using xMII 11.5.  We are having difficulty retrieving values assigned to our created session variables. 
    We have defined 2 users, each associated with session variables whose values differ by user.  Each user is associated with a different irpt page which retrieves information based on the values passed by the session variables.  Both pages return correct information in the grid using the as the param.1 value on the opening of the page. 
    On one page, we are able to retrieve the values of the session variables in Javascript by placing hidden fields on the document and using the document.getelementbyID("hiddenValue1").value.  The other irpt will only bring back the name of the of the session variable in the curly braces, .
    Both users are set up the same in System Security and Data Access.  If we switch the pages opened for the user in the Portal Navigation, one page will return the values no matter which user and the other page will always bring back the session variable name in the braces.  This makes us believe that it is not a problem with the user setup or the definition of the session variables.
    Would anyone be able to help us understand what needs to be done to correct this issue?

    Michelle,
    Have you tried URL encoding your irpt pass through parameters in your Navigation link?  Perhaps the commas and parenthesis are causing some issues ( http://help.sap.com/saphelp_xmii115/helpdata/en/Getting_Started/Template_Editor/Query_Construction.htm )
    Just to clarify, the Role/User attributes defined in LHSecurity are truly session properties, and the session properties are shown by the PropertyAccessServlet results.  Adding the name/value pairs to the URL are only a one-shot pass through to the ReportServlet that processes web pages with .irpt extenstions, so they don't actually set the session properties and are non-retentive beyond the one page.  As you are presently doing with the navigation links, we typically recommend URL passthroughs for page to page activities and using the session itself for name/value pairs that you want to set once and use anywhere throughout your application.
    document.APPLET.getPropertyValue(NAME); will also give you access to the session through javascript, but if you do a view...source in the browser after your TeamLeaderView web page has loaded you should see the results of the search/replace efforts of the ReportServlet, and the javascript you are using to get values out of hidden form field elements should simply reflect the text you see in the view source window.
    If they work inside APPLET tags like you mentioned for Param.1 you could also use document.APPLET.getQueryObject().getParam(1); instead of the hidden form field elements, and remember that you have 32 params and if they are not used in the underlying query can provide a very nice place to 'catch' the results like you are are doing with hidden form field elements that could potentially get reset by a form button.
    Regards,
    Jeremy

  • Urgent regarding session variable

    Hi Everyone,
    I have a prompt having fromdate(calendar ctrl) and todate(calendar ctrl) and one orderID(here it is multiselect). Now my requirement is i should select an order ID from the multiselect and when i hit go the date should be prompted for the fromdate and todate and these should pass in the report.
    Please help me how can i pass the session variables for the 'fordate' and 'todate' based on the orderid i am selecting from multiselect.
    Thank you so much for your help.
    Thanks,
    chakr

    Hi,
    In the Dashboard prompt u can see edit column--> edit column formula--> here select varaible type as ---> session then include...see the screen short.
    http://imageshare.web.id/images/2c3f2h66sb7l5nzfittl.jpg
    1) In your DB Prompt go to Default To
    2) Select Server Variable
    3) NQ_SESSION.startdate and NQ_SESSION.enddate
    4) Save and test
    That should work well for you. Here is a link to a jpg that you should probably save for future reference. It'll show you the proper syntax to use in different situations.
    http://shivabizint.files.wordpress.com/2008/10/obiee-variables-overview.jpg
    Thanks
    Deva

Maybe you are looking for

  • Urgent help needed - deadline - iDVD project suddenly gone corrupt?

    Ive literally finished and ironed out the problems Ive had with a big Dual Layer project Ive been working on for 2 weeks. Yesterday I successfully burned a project to DVD - and I had not been having any problems. Then suddenly I tried another burn la

  • ComputeSpectrum not working in CS6

    I use computeSpectrum in many CS5.5 Flash applications. I just installed CS6 and when I compile the same file the byte array sent back by computeSpectrum is mostly empty. Seems to be a bug in the built player 11. I downgraded toi 10.3 and it still do

  • Connection to https AEM URL (SSL)

    Hi, I am not able to connect to AEM (5.6.1) version from Adobe Drive 5. Please help. URL : https://dam.corp.abc.com

  • Running MDX Query in BEX

    I've a question regarding MDX Query . 1.Can we run MDX Query in BEx. 2.If yes , then can you please tell me how and where can we run MDX Query in BEx. Regards, -Neha

  • Upgrading to Photoshop CS5 from Photoshop CS4 Upgrade

    I want to upgrade from CS4 to CS5, but CS4 is an upgrade. Can I still upgrade to CS5 even though CS4 is an upgrade?