Maintaining session across multiple browser windows and page refreshes

Hi there,
We're currently developing a Flex application with a couple of session-related requirements that we're not sure how to solve. Before we jump in and maybe go about things in the wrong way, I thought I'd post and see if anyone here knows of some elegant solutions!
Currently, when our Flex app starts the user is presented with a log-in screen which authenticates the user against our server. Client-server communication is done through BlazeDS.
Our first requirement is the ability to open a new browser window from Actionscript - this window will load a pdf document. The servlet that serves this pdf should deny the request if the user is not already logged in. The only way we can see to do this so far is to open the pdf url using navigateToUrl() with the '_blank' target, passing a jsessionid token as a url parameter. Is there a better way to preserve session state when opening a new window?
The second requirement is to preserve some application and session across browser refreshes. Our Flex app has several screens that the user can tab between. If the user hits F5 or the refresh button in their browser, we'd like the app to return to the same screen after the refresh. I've been looking into using BrowserManager to add a fragment such as #screen=2 to the url, but of course we only want the app to display screen 2 if the user has already authenticated with the server. Is there a way to reuse the user's existing session credentials after a page refresh?
Many thanks in advance for any advice anyone can offer on this. It could very well be that we're missing something about how BlazeDS uses / exposes session credentials that would make all of this easier to implement than we currently realise!

We use javascript to pass values between a 'data look up' window and the originating Servlet. If this is of any use, I can send you some examples.

Similar Messages

  • MAintain session across multiple DB Adapters.

    Hi,
    I am using a BPEL process which has multiple DB Adapters.
    As far as I understand each DB Adapter call from BPEL is a different session.
    Is there any way to maintain a same session across multiple DB Adapter calls i.e to make multiple DB calls in the same session?
    thanks,
    CD

    Yes this is supported.
    You'll have to take a look at the support for XA (distributed transactions).
    See this thread for some good links to other info.
    Re: DB Rollback Questions for 10.1.3.1 and 10.1.3.3

  • Session across new browser windows

    Hi All,
    I am facing an issue with HttpSession when trying to open new windows in my web application and trying to acess the session from the new windows and want your expertise in solving this problem.
    Here is the scenario:
    1. The web application is opened in a browser window, this creates a new session and the JSP adds some stuff to the session.
    2. Down the line in the app using the menu's user invokes a JSP in a new browser window using window.open JavaScript command.
    3. This JSP tries to get some information from the session (which was added by the opening JSP) and fails as it gets a new session. I know this coz i checked the session ID in both JSP (opening JSP & new JSP) and they are different.
    Is there a way I can aviod this. Can the new JSP join the existing session?
    Thanx a lot in advance for all your help on this.
    Rgrds,
    Ritin

    Well cookies are enabled on the machine but I am not using anything special. I am just sending the request and using the session object made available by the JSP container ('session' variable in JSP).
    What I am doing is just submitting the request in the new window without any URL encoding or anything.
    BTW can you explain what you meant by URLencode. How can I do that?

  • Maintaining session across multiple browsers

    Hello All,
    We have an application that runs using Apache Struts. One of the requirements is to pop-up a "data look up" window, i.e. a new browser window. The problem is, when I start this window any communication between this new window and server happens on a brand new session. I would like to maintain the same session as the parent window. Any ideas?

    We use javascript to pass values between a 'data look up' window and the originating Servlet. If this is of any use, I can send you some examples.

  • Best way to approach... Wizards and Multiple Browser Windows?

    How have others got / would others get around the following problem?
    I have a 4 page custom-built wizard to collect information about people and then, on the final step, insert that information into my PERSONS table. I use the same 4 pages as an Update wizard as well (I have a hidden item which is set either to 'CREATE' or 'UPDATE' depending on whether the wizard is in CREATE "mode" or UPDATE "mode" which I can then use in conditions to tell the app which process to run.) This works nicely and by using the same 4 pages for both my update and create wizards it means I need half as many pages.
    When a user enters page 1 of the wizard in UPDATE mode, pages 1, 2, 3 and 4 are populated with details of the person record they are updating. They can then change the values they wish, navigate to the end of the wizard with the "Next" button and then save the changes.
    When a user enters page 1 of the wizard in CREATE mode, I clear the cache for pages 1, 2, 3 and 4. The user can then navigate through the pages using the Next button and then click "Save" to save the new person (perform the INSERT into the DB).
    The problem comes when the user is half way through an update wizard and then, for some reason known only to the user, decides to open a new browser tab/window and start a Create Wizard in this new tab. Starting the Create Wizard has the effect of clearing the cache for the 4 pages which is an issue for when the user goes back to his other tab and tries to continue with the Update Wizard he was half way through (because all the items will have been NULLed). This problem occurs essentially whenever the user initiates one wizard (CREATE or UPDATE) when he is already half way through another one: One of the wizards is always going to get "messed up".
    I would be interested to hear how others have dealt with this problem in the past? Somehow limit the user to having one Wizard open at a time? Or something else?
    All/any comments/thoughts/suggestions much appreciated,
    Thanks
    Andy

    Hello,
    Well the easiest way around it is user education. Just put an information blurb on the right that says.
    >>
    Running this wizard in multiple browser windows or tabs will/could cause malformed data to be saved.
    >>
    Just like when you do online credit card transactions and they tell you not to click twice or you get charged twice.
    The problem is that the same browser , if in different windows or different tabs, will share the same session.
    You could maybe store all your information in a collection or something and not save or clear cache till the end, but that seems like overkill, just put some text in there that says don't do this!
    Carl

  • Maintaining Transaction Across Multiple JSP Pages

              Hi,
              I have a multi page Registration (3 steps). On each step data submited is taken
              to the database via an EJB component (Session Bean). How do I maintain a transaction
              across these JSP pages so that the data in the database is consistent. If a there
              is a problem in the 3rd step the data submitted in the first two steps should
              be rolled back.
              How do I maintain transaction across multiple pages.
              Regards
              -MohanRaj
              

    It will take from several minutes to a long time for a user to complete a multiple page registration process. Do you really have enough database connections that each concurrent user can hold on to one?
    Usually you cannot open more than 50-200 connections to a database at any given time.
    Remember that some users will abandon the registration process. Can you afford that their sessions holds a db conenction until the session times out?
    Consider changing your datamodel so you can run and commit a transaction at the end of processing the form data from a page. Immediately after the commit give the db connection back to the pool inside the app. server.
    It can be as simple as having a column in the database of type enum, with a set of values that shows how far in the registration process the registration has procesed.
    BTW. if you absolutely have to hold on to the db connection, you can stuff it into a session scoped attribute and it will be available on all pages.

  • Open discoverer report in new browser window and without connections page

    Hi All,
    We are using Oracle 11g Discoverer 11.1.1.4.  Requirement is to open the discoverer report in a new browser window and without connections page.
    When we are running discoverer reports with this parameters we unwantedly get the connections page of the discoverer plus which we don't want.
    Went through the documentation given in this page and followed it still the issue persists, and i see couple of threads with my issue and no updates.
    This excerpt is from the documentation available in the link
    " _plus_popup=true and framedisplaystyle=embedded launches Discoverer Plus in a new pop-up browser window that contains the Plus applet embedded in it "
    http://www.art2dec.com/documentation/docs/oas10g1012/linux/bi.1012/b13918/urlstart.htm
    and Here is what we use to invoke our reports.
    http://ipaddress:port/discoverer/plus?cn=cf_123&_plus_popup=TRUE&framedisplaystyle=EMBEDDED&wb=disc_wb_1
    Request the forum users from PRO discoverer group to help me out of this issue and expect a good discussion on this.
    Thanks in advance

    Closing the thread
    We were able to achieve by changing the browser settings in the IE 8 Browser. Disabled Tabbed browsing.

  • If I have multiple browser windows open (not tabs, windows) and I close 1 of them, why do ALL browser windows close?

    If I have multiple browser windows open (not tabs, windows) and I close 1 of them, why do ALL browser windows close?

    How are you closing the window?
    Are you using the File menu or the close X on the title bar?
    Use Alt + F to open the File menu with the Close Tab entry visible (doesn't work with the mouse).

  • FIREFOX 26 changed the 'post crash' page with the list of windows and pages. It was a real HTML page with links for each page. Now it isn't (and blows)

    * You changed the page that comes up after a crash - the one which shows the windows and pages that were up before the
    crash.
    This used to be a real HTML page and it isn't any more. THis choice was pure isiocy consider how peopel used that page every day (try taking to your users for a change).
    The pages listed on that 'post crash page' used to be actual LINKS (you could right click them &
    manually open them in another tab - and most peope DID that every day). You could also (and I did this a lot) drag a second
    copy of the page, into a new tab (to keep track of all the pages I had not wanted to open)
    Now the pages are no longer links. You cannot right-click them.
    The thing in the probser is no longer a page that I can drag into a new tab.
    Roll the version back and throw this one in the bin...and have a good long talk with your developers about the definition of
    'STUPIDITIY'
    Then I try to type anything in the addres bar it is suppose to repoond with the history of old things I have types in the past, or
    search for what I type (and in some cases I think it tyes to convert it intoa URL). However it no longer does any of these
    things. When I type in the ADDRESS BAR ONLY, I do not get all of my letters to appear. I have to type into a notepad or
    into the search and to copy and paste to go to a URL. Nothing that is typed into the address bad responds normally at all
    anymore, and I am fairly certain there are no new addons on this machine at all. It does not matter which things I disable. It
    still does this. W of course points the finger back at a change to FIREFOX. I wich I could just sitct with one stable release
    forever but the MOZILLA folk thing it is best to force peopel awy from a working broswer release to a horrible one (due to it
    being out of date).
    FIREFOX 26.0 has 'issues' (ie new *features*/bugs)
    1) History is no longer accurate. My Proof? This machine is the primary one for the entire family (the only PC working). It is
    logged in with same user every time and never has its history cleared. It now January 7 so I ought to have a list of all of last
    months browing available to me.
    However, according to FIREFOX history, in all of December 2013, the entire family only went to 51 primary URL's. None of
    the official TV sites I use to get episodes are listed. None of the official movie sites I use are listed. The primary URL for
    ebay is not listed. Only 1 out of our 4 weather sites that I use (at least once a week) are listed. Only 1 of our 3 FINANCE
    sites is listed. There ought to be several; hundred root URLs listed.
    Please fix history as this change seriously "blows greasy chunks"
    PROBLEM (a stupid change in the new FIREFOX version)
    FOr a long time, after a crash you got a useful page (a real HTML page) which gave you a list of all of your last sessions
    'winwos and tabs' that were open when the browser crashed. there were certain ways of using this page that are no longer
    able to be done.
    The old method was wonderful as it had this behavior :
    *** The old method for displaying your 'Recovered Tabs' allowed you to :
    a) right click an individual item and open it in a tab without getting rid of that lovely window of your previous session of
    'recovered windows and tabs '.
    2) drag the URL for the entire window of 'recovered windows and tabs ' to a new tab (to make a second copy) so that you
    could select just a few of them to open as a group, and stil have the old list handy.
    You can no longer do either of these things. The 'recovered windows and tabs ' page no longer has links in it and can no longer be dragged, so you cant select a few of them to use, and keep the rest around for later. NOW - once you choose which pages to open the window is gone forever (can can't get a second copy).
    People used to make a copy of the page for later use (with a drag)
    we also used to open pages with a right click (which no longer functions
    This new method seriously blows big greasy chunks. A parge loss in function has occurred.
    Put things back as they were. 26 is full of terrible changes that NOBODY likes. It also has a lot of bugs (history is not reliable at all)

    (1) Firefox's built-in post-crash page has not been a real HTML page for a long time (for example, from the time of Firefox 22, see: [https://support.mozilla.org/en-US/questions/968212 Want to save LOTS of versions of "Restore Session.xht" from the "oops ..." page for later use]). If you had this working differently with Firefox 25, that might have been created by an extension.
    You can check to see whether extensions are disabled or need an update on the Add-ons page. Either:
    * Ctrl+Shift+a
    * orange Firefox button (or Tools menu) > Add-ons
    In the left column, click Extensions. The disabled extensions cluster toward the bottom of the list. To poll for updates, use the "gear" button above the list and choose Check for Updates.
    If you used the Reset feature (or Firefox automatically did a reset due to some problem during upgrading), you will need to reinstall missing extensions. The reset feature creates a folder on the desktop named Old Firefox Data. Do you have that folder? There may be data you can recover from it.
    (2) There are many ways for history to get cleared, both internal to Firefox and external. Could you double-check your Privacy settings?
    orange Firefox button (or Tools menu) > Options > Privacy
    * The "Firefox will" drop-down says Remember History: Firefox shouldn't be clearing history, but an add-on or external software could do it
    * The "Firefox will" drop-down says Use custom settings for history: inspect the "Clear history when Firefox closes" setting to make Firefox isn't set to clear history. Also check your add-ons and consider external software.
    Firefox normally accumulates months of history. However, some of Firefox's database sizes are based on disk space available. If your hard drive is very full, Firefox might reduce the amount of history stored.

  • Share http session across multiple EARs

    I am curious to know the following:-
    --> is it possible to share http session across multiple EARs running on same Weblogic application server.
    i.e weblogic server/Jboss
    --> is it possible to share http session across multiple EARs running on different Weblogic application server.
    i.e weblogic server/Jboss
    Please share the steps/way to acheive the same.

    What are you trying to achieve / accomplish by splitting it up?
    e.g. Clean Build in workshop will be faster for multiple EAR's , but unless you have all your application level libraries as shared libraries you might increase your runtime footprint. or you might want independent deploy/redeploy for your apps etc.
    If however you need the session to be shared , that these aren't really independent web-applications and shouldn't be separate ear's. In most cases though you dont actually need the session as shared (e.g. a user's data is fetched from the database , you dont really need the session shared, you need a single shared sign on). So when you say is the session shared, what is the data that you need shared? should it be in the session in the first place?
    And finally are these webapp's really independent (functionally ) or not?
    Edited by: deepshet on Oct 13, 2009 2:09 PM

  • Creating multiple browser windows in Flash or Dreamweaver

    I created a Flash site with several scenes. Is there a way to
    command and code in Flash via Action Script and/or Javascript the
    creation of multiple browser windows each holding one of the scenes
    upon the release of a button corresponding to a respective scene?
    Can this be done in Dreamweaver alternatively? If so how? Can it be
    done at all?
    Thanks so much.
    Jody W

    Hi Gorka:
    I’m finally able to focus on your suggestions and
    hopefully finally finish my site. Just to make sure I’m clear
    on your advice using a scene called “paintings” as an
    example, I discard my earlier code such as <PARAM name =
    “FlashVars” value = “jodysite_paintings.swf =
    paintings”>, and replace it with the code you suggest that
    would look like this once completed (below)?
    <PARAM name = “FlashVars” value =
    “jodysite_paintings.swf =<?php echo $_GET[' paintings
    '];?>”>
    <EMBED FlashVars = "jodysite_paintings.swf=<?php echo
    $_GET['paintings'];?>"></EMBED>
    And in the Actions window for the button that would open a
    new browser window upon release for the “paintings”
    scene, the Actionscript for that button would read:
    getURL("javascript:window.open('
    http://www.jodywidelitz.com?scene=paintings','Paintings',
    toolbar = no, menubar = no, scrollbars = yes, location = no,
    fullscreen=yes, width=1024,height=768); void(0); "_blank", "GET");
    if(paintings != undefined){
    gotoAndStop(paintings, 1); 1 is for frame 1
    This is the way I have the code now, but I developed a glitch
    as soon as I changed the code. My preloader stays caught up in a
    continual load that won’t finish, and won’t advance to
    the next scene. It was working before I entered any FlashVars
    coding. So the Flash movie embedded in Dreamweaver stays blank.
    Also, I am using the original Flash MX and Dreamweaver MX from
    2002-2003. By some chance, does this earlier version of Flash MX
    not recognize FlashVars? I do have the DOCTYPE as <!DOCTYPE HTML
    PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> to allow any
    deprecated code, etc.
    Thanks again,
    Jody

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • Error message after update "Safari cannot open a browser window and may be

    My daughter just did an update and got the following error message: "Safari cannot open a browser window and may be missing important resources. Try installing Safari again.
    Any thoughts or tips as to what happened?

    Just a few pieces of clarifying information... This is Safari on OS X you're talking about, right? Also, what update did your daughter install? Have you tried reinstalling Safari (you can download it from Apple's site)?

  • I have a problem, when i start the project i open the browser window and whenh i select a clip premiere stops working!!!

    i have a problem, when i start the project i open the browser window and whenh i select a clip premiere stops working!!!

    More information needed for someone to help... please click below and provide the requested information
    -Premiere Pro Video Editing Information FAQ http://forums.adobe.com/message/4200840

  • Open a browser-window and show an Internetpage of a certain URL

    Is there any class or package with a member, that can open a Browser-window and show an Internetpage of a certain URL?

    open a browser window: not sure you can do that ; though you can try with Runtime.exec() but you will have to choose the browser that should open and if the comp does not have it you're stuffed
    read the content of an URL: i think you can do that with methods of URLConnection class :)

Maybe you are looking for

  • Problem with bottons in a clip

    Hi I created a clip in which I've put several bottons... the idea is to create a menu that drops under the botton to give a choice of several subclass... Exemple for my botton media I want a submenu dropping under with the bottons "video" "music" "ph

  • Light markings on screen

    I purchased my MacBook Pro in July of 2010 for school and have had to use it on a day to day basis since and therefore have not yet been able to contact apple to fix the problem that I am currently having. This problem is recent, occurring within the

  • Windows 8.1 DPI scaling and remote desktop issues

    On my desktop display (2560*1080 21/9 display) I am using no DPI scaling. (100%) When I remote into this machine from my Surface Pro tablet the display changes to 1920*1080 to fit the surface's display and scaling also kicks in. (125%) When I afterwa

  • MacBook Pro shuts down instead of sleep

    My daughter's macbook pro is supposed to sleep when the lid is closed but it usually shuts off the hard drive instead.  She has a 15", 2010 model with the latest software and updates.  Any suggestions?

  • ACE not passing the traffic to the server.

    Hi Experts, Could you please help me on this issue:- The users are not able to access the palm application passing through the ACE module. The clients gets to the citrik server and from ther it goes to palm application. Now both external and internal