Problems accessing session variables from a pop-up

I am working on a webapp and I when I click on a certain button I need to have a pop-up appear that will either prompt a user to enter log-in info if they haven't already, otherwise the pop-up just needs to display a report. Users can navigate around on the main page and select various reports so multiple pop-ups could possibly be opened. When a user logs in I save the login info in session variables, but for some reason whenever I click to have another pop-up open it always says that my session variables are null. Is there a way to have more global session variables so that multiple windows (the pop-ups) can touch session variables? Would there be a way to pass the login info in session variables back to the main page and then pass those session variables back out to each pop-up that opens? Thanks so much.

Have you got session cookies enabled?
The most common way to keep track of the session id is via a session cookie.
This cookie gets shared by all windows of the same browser session.
You are opening these pop-up windows with window.open?
Print out the session id <%= session.getId() %> on each page to see if it is the same.
Cheers,
evnafets

Similar Messages

  • Problem accessing session variable from jsp

    Hi!
    I get an error retrieving a session variable from inside a JSP declaration scriptlet....
    Something like this code in a JSP page:
    <%!
    public void funtion1() {
    String parameter1 = session.getAttribute("parameter1");
    %>I have seen that I have available getContextServer() method and from there I could call getAttribute("parameter1") . But the thing is that the attribute I want to retrieve was stored in session by another Jsp page.
    Any solutions are welcome
    Cheers
    Victor

    Appropriately the above is one the reasons also You cannot use JSP implicit objects from the declaration tag. However we can think of a small workaround by passing the reference like the one discussed below
    <%!public void funtion1(HttpSession session) {
    String parameter1 = session.getAttribute("parameter1").toString();
    }%>
    <% funtion1(session);%>Hope that helps :)
    REGARDS,
    RaHuL

  • JNDI Naming Problem accessing Session Bean from Message Driven Bean

    Hi,
         I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocator (I have implemented ServiceLocator pattern to obtain JNDI reference for all EJBs). When I am calling the session fa�ade EJB from the Struts Action class everything is working fine.
         But when I am trying to call the same EJB from my Message Driven Bean, I am getting a JNDI exception (NameNotFoundException - No Object bound to name �java:comp/env/ejb/EJBJNDIName�). I am trying to get the remote reference from the same ServiceLocator which is successfully providing me a reference while calling from the struts action class. But the same ServiceLocator is not able to provide me a reference while calling from the Message Driven Bean. If I use the JNDI name directly like �EJBJNDIName� in the lookup it is working fine. The lookup for the name is working fine and I am able to call the Session Fa�ade bean with that reference.
         I am really not sure what exactly the problem is. If I have any problem in the ServiceLocator, it should have given me the same error while calling from Struts Action class. But it is working fine with the full name �java:comp/env/ejb/EJBJNDIName� calling from the struts action class. I am not sure whether Message Driven Bean has something to do with it. Why I am not able to get a reference of the EJB with the full name? Please Help.
    Thanks
    Amit

    Hi Bhagya,
    Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
    Thanks
    Amit

  • Problem accessing session variables in JSP

              Hi all,
              i am retrieving the value of session variables in a JSP page. the session varibale
              is set at the
              server side. sometimes the jsp is able to retrieve the value and sometimes it
              doesn't.
              Thanks & Regards
              Tarun
              

    if getAttribute return null so there is no such session attribute,anyway
              check your browser if cookies are enabled.
              "Tarun Mangal" <[email protected]> wrote in message
              news:400759e9$[email protected]..
              >
              > Hi all,
              > i am retrieving the value of session variables in a JSP page. the session
              varibale
              > is set at the
              > server side. sometimes the jsp is able to retrieve the value and sometimes
              it
              > doesn't.
              >
              > Thanks & Regards
              > Tarun
              

  • Accessing session variables PHP

    I am trying to access a session variable from a log in form (using the Log In User Server Behavior) and am lost. I simply want to display the users information in the target page. I read in another discussion that I had to bind the variable to the target page, which I did, but that didn't fix it.
    Please help.
    Here is my loginFormAction code:
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['email'])) {
      $loginUsername=$_POST['email'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "owner.php";
      $MM_redirectLoginFailed = "register.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_petriever, $petriever);
      $LoginRS__query=sprintf("SELECT email, password FROM owners WHERE email=%s AND password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $petriever) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;      
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>

    Wherever you want to display the logged-in username simply place this on the first line of a .php page to start the session:
    <?php session_start(); ?>
    Then place this code wherever you want to display the username:
    <?php echo $_SESSION['MM_Username']; ?>

  • Accessing session variables with php

    I am trying to access the  session variable  $_SESSION['MM_Username']  in one of my php pages, but it is somehow showing empty (i.e it does not contain the username that was entered during login).
    I checked and confirmed that my login.php function is properly setting the MM_Username session variable by echoing it  from the login function.
    So why can't I read it from another php file in the same session?  Do I need to do something else before the session variables can
    be properly read from any php file in the same session?  Any help would be appreciated.

    Here is a test code I am using to access the session variable $_SESSION['MM_username']  from  the php page  test.php. But it is not working.
    I get an empty string all the time for $username. Can any one see something wrong with this code?
    <?php require_once('Connections/MyTestingConn.php'); ?>
    <?php session_start(); ?>
    <?php
    $username = "-1";
    if (isset($_SESSION['MM_username'])) {
      $username = $_SESSION['MM_username'];
      echo $username;
    else
       echo "Eror: can not access session variable";
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test</title>
    </head>
    <body>
    </body>
    </html>

  • Looking for resource: accessing session info from JPS portlets

    Hi! The Portal Developer's Guide 10g Release 10.1.4, section 7.2.5 shows how to access session information from PDK portlets. I'm looking for information (tutorials, books) on how to do this from JPS portlets in the Oracle Portal environment.
    Thx!

    If u are using JSPProvider, then for getting the Session variable, peruse the below points:
    JSPProvider p=(JSPProvider)pageContext.getAttribute("JSPProvider");
    Session ses=p.getSession();

  • How can I access JSP variables from a JavaScript function in a JSP page?

    Respected sir
    How can I access JSP variables from a JavaScript function in a JSP page?
    Thanx

    You may be get some help from the code below.
    <%
        String str="str";
    %>
    <script>
        function accessVar(){
           var varStr='<%=str%>';
           alert(varStr);// here will diplay 'str'
    </script>

  • Accessing public variables from other classes

    Probably a simple questions, but how can I access a variable from another class. My exact situation is as follows.
    A class called WorldCalender has a variable which is defined: public int hour; (the value is given to it elsewhere).
    I want to access this variable and increase it by one in a subroutine in the class Hour. In this class I have put: WorldCalender.hour++; but it doesn't seem to work. How should I do it?

    don't expose the hour variable at all.
    have a method eg addToHourBy( int hrs )
    Probably a simple questions, but how can I access a
    variable from another class. My exact situation is as
    follows.
    A class called WorldCalender has a variable which is
    defined: public int hour; (the value is given to it
    elsewhere).
    I want to access this variable and increase it by one
    in a subroutine in the class Hour. In this class I
    have put: WorldCalender.hour++; but it doesn't seem to
    work. How should I do it?

  • Access session variable inside AM module

    Is there any way to access session variable inside AM module custom function?
    I created one client interface function in AM and want to access one session variable value inside AM custom function.
    Please suggest.
    Thanks

    Hi
    here i need help to find out right approach,my use case are below
    1.User will login thorough SSO .
    2.Based on used id i need to display user data in table form.
    3.User-id will need to display in right corner of page template ( JSF page with this page template)
    4.user can update/create new table data by pressing update/createinsert button.
    5.Once user press the create new request button,one empty row will popup which have user-id filled automatically (used-id who logged in) and will read only ,so that once user commit the data,DB can update/insert the data with that user-id
    so far i have done point 1,2,4 and 5 like
    1.i created AM preparesession and store the use id.
    2.i have putted whereclause in AM for particular VO and run execute query and able to see particular user data,who logged in.
    4.created servicemethod for createinsert in AM and exposed it ,and set used-is table attribute which i got in AM preparession .Now i am able to see new row with user-id in one column in read only form when
    Is this the right approach ? and now i am not able to do step 3 so how to display same user-id in pagetemplate as this value is available in AM only.

  • Passing Session Variable from PHP to Applet

    I'm trying to pass a session variable from a PHP script to a third party applet. The applet needs to accept the variable as a string into a parameter. I think the htnl has to be dynamically created to turn the session variable into a string for the parameter value. Any suggestions ?

    This is really a PHP question. You might get better results on a PHP forum.

  • I have a new Macbook pro and need to run some Windows software, it appears "Parallel" should work well from what I've have read. Will I have any issues or problems accessing and printing from various printers on my Windows 7 network within Parallel?

    I have a new Macbook pro and need to run some Windows software, it appears "Parallel" should work well from what I've have read. Will I have any issues or problems accessing and printing from various printers on my Windows 7 network within Parallel? Is Parallel in fact the best way to go?

    First, back up all data immediately, as your boot drive might be failing.
    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Reset the System Management Controller.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Check your keychains in Keychain Access for excessively duplicated items.
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • Adding session variables from a recordset

    I'm trying to create a session variable from data from a
    recordset, can anyone help?
    this is what I want the session variable to be from the
    recordset:
    <?php echo $row_rsStrata_plan['plan_str']; ?>
    but I'm not sure where to go from here: $_SESSION[test] =?
    Thanks,

    Make sure you have <?php session_start(); ?> at the top
    of your page
    Then
    $_SESSION['test'] = $row_rsStrata_plan['plan_str'];
    Gareth
    http://www.phploginsuite.co.uk/
    PHP Login Suite V2 - 34 Server Behaviors to build a complete
    Login system.

  • How to get and set a session variable from backing bean?

    Hi im using Jdev 11.1.1.2.0 and i need to set and get a session variable from backing Bean.
    Any idea?

    the class :
    package arq.resources;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class SesionSigef {
    public FacesContext context;
    public HttpSession session;
    public SesionSigef() {
    super();
    context = FacesContext.getCurrentInstance();
    session = (HttpSession)(context.getExternalContext().getSession(true));
    public Object getVariableSesion(String atributo){
    return session.getAttribute(atributo);
    public void setVariableSesion(String atributo,Object valor){
    session.setAttribute(atributo, valor);
    the example of use :
    SesionSigef se = new SesionSigef();
    DatosRec da = new DatosRec();
    da.setDocumentoCip("Aprobar");
    se.setVariableSesion("DatosRec", da);
    thanks
    Joaquin

  • Access Session variable inside Transaction

    Hi All,
    Is it possible to access session variables inside Transaction.
    Create session variable.
    Update session variable value
    acccess Session variable.
    (user session)
    Regards,
    Sachin

    Hi Sachin,
    Here is the snapshot:
    1. Take session variable in a local JS variable in HTML page.
    2. Create a transaction with a input type variable in Transaction Properties.
    3. Create a Xacute query and link the above transaction.
    4. Creata a iCommand applet on HTML page and link the query template:
    <PARAM NAME="QueryTemplate" VALUE=".../QueryName">
    Call the function in the below way in HTML:
    Applet.getQueryObject().setParam(1,vaiable)
    So, the session variable will go to TRX (BLT) and perform the operations as per your need..
    You can pass it to other TRX by the same way.
    To fetch the value: Create output type variable in TRX 2. Create Xacute query.
    Get the value with : Applet.getValue(1,1)
    Hope it is useful.
    Best Regards,
    Kedar

Maybe you are looking for