New session created with every page request

Hi,
I have an application running in portal framset. A user logins into a portal and has access to several applications, that are displayed in a frameset. My application is creating a new session for every page in the application. Of course, I can't keep session variables and a large amount of sessions are being created. What could be the reason for this, and is there a work around?
Thanks.

There is a chance the you have cookies turned off. Sessions are maintained via a jsessionid which is stored in a user cookie. If you (or another user) don't use cookies, then the session will be lost.
To fix this, every URL you use must be encoded, such that, if cookies are not used, the jsessionid is attached to the end of the URL. If you are using JSTL, the easiest way to do this is like this:
<c:url var="formAction" value="someOtherPage.jsp"/>
<form action="<c:out value="${formAction}"/>" method="GET">
<c:url var="nextPage" value="nextInLine.jsp"/>
<a href="<c:out value="${nextPage}"/>">Next</a> Or if you are not using JSTL, you can use scriptlets:
<%
  String formAction = response.encodeURL("someOtherPage.jsp");
%>
<form action="<%= formAction %>" method="GET">
<%
  String nextPage = response.encodeURL("nextInLine.jsp");
%>
<a href="<%= nextPage %>">Next</a>

Similar Messages

  • New session created with every request

    Hi there,
    I have an web application that we used to deploy on tomcat, websphere and bea without any trouble. We are trying to move to support OAS and the application gives this peculiar behavior:
    A new session is created with every single request by the client browser. I have searched these forums for the better part of today and read some interesting similar cases but none of the fixes seem to have any effect on my problem.
    Is there a different way I need to request the session object from the request in the app for OAS? Or is there a configuration that I should have? I am deploying the app as a .war file. Is there a better way to deploy on OAS, should I stick the war in a .ear?
    Any help on this would be most greatly appreciated!
    Thanks,
    -Adam

    I have a problem that matches with this subject line but its somewhat different. This original posting wants to create new session and invalidate the existing one but my problem is to keep the session invalide if it has expired for the browser.
    Anyways, here is my problem. I have JSP named entity_actions.jsp which has 3 pop-up links that opens up with code like:
    window.open('restaurantentry.do?entityName=restaurant')
    window.open('districtentry.do?entityName=district')
    window.open('baseentry.do?entityName=base')
    My web.xml has this tag:
    <session-config>
    <session-timeout>5</session-timeout>
    </session-config>
    And the way forward the response for each request is:
    context.getRequestDispatcher(urlString).forward(request, response);
    The code I check for session timeout is:
    private void checkForSessionTimeOut(HttpServletRequest request)
    throws SessionTimeoutException
    HttpSession current_session = request.getSession(false);
    logger.info(CLASS_OBJECT, "Session in checkForSessionTimeOut(): "+current_session);
    if (current_session == null)
    logger.error(CLASS_OBJECT, "SessionTimeOutException has thrown.");
    throw new SessionTimeoutException("sessionTimeOut");
    Now lets say I want to show the end user session expiry page after 5 mins of idle time. Now from entity_actions.jsp when I click/open any one popup first time after 5 mins of idle time/session expire,
    logger.info(CLASS_OBJECT, "Session in checkForSessionTimeOut(): "+current_session);
    this loggers shows current_session as 'null' and I can display session exp mesg on the popup page. But when I click/open any other popup or any other link on the page it DOES WORK instead of having current_session = null, it creates new one. And I can see the sessionid which is different than fist session created on the same base page/browser.
    The same pattern of code used to work on Tomcat and JRun before for showing consistant session expiry on all the clicks being made on the same browswer after session gets expire.
    Why OC4J / JDev 10.1.3 is creating new session on the same browser even after session has expired?
    How can I fix this?
    Thanks

  • I like to keep 2 sessions open, but today a new session opens with blank page and no bookmarks - why?

    I keep a session open pretty much all day but minimize it when I leave so someone else can use a session for whatever they want. Today when I open a new session (while mine is minimized) the page is blank and there are no bookmarks. I can hit the home icon and go to view and see my bookmarks but this is a pain

    Hey mate,
    I was having the same problem. If you upgraded to Lion - apparently there is a 'general tab' in the system preferences that has a box that you need to un check. (The box says something about restoring all last windows from last session)
    If you updated Safari but are not using Lion, here is how to fix it. Simply delete this item fromyour Mac HD and restart Safari.
    [USERHOME]/library/preferences/com.apple.safari.plist
    Hope this helps... It worked for me!

  • New session started with an advertizing page and all my tabs are lost

    New session started with an advertizing page and all my tabs are lost. Restore the previous session is not active. How can I restore my tabs?

    This advice might come too late, but, don't exit Firefox! Or if you already did, don't start it back up again!
    ''If Firefox is running:'' Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This should launch a new window listed various files and folders. For best results, change the view to "Details".
    (''If Firefox not running, get to this folder by pasting the following in the Run box on the start menu and pressing Enter: %APPDATA%\Mozilla\Firefox\Profiles and then double-click into the most recently updated semi-randomly-named folder you find there.'')
    In the window that launches, scroll down and double-click into the '''sessionstore-backups''' folder. Save all files here to a safe location, such as your Documents folder, so Firefox doesn't overwrite them. We may be able to use them to recover your lost tabs.
    Also, if you return to the main level of the profile folder, you may find some sessionstore files. Copy those to the safe location as well.
    Could you report back on what you found?
    Note: If Windows hides the .js file extension from you, you can change a setting so that you can see all file extensions (this helps when renaming files). This support article has the steps: http://support.microsoft.com/kb/865219 or http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions
    The kinds of files you may find among your sessionstore-backup files are:
    * recovery.js: the windows and tabs in your currently live Firefox session (or, if Firefox is closed, your last session)
    * recovery.bak: a backup copy of recovery.js
    * previous.js: the windows and tabs in your last Firefox session
    * upgrade.js-''build_id'': the windows and tabs in the Firefox session that was live at the time of your last update

  • How can I expand the gutters in a document created with a Pages brochure template?

    How can  I expand the gutters/ space between panels on a document created with a Pages brochure template?

    You haven't said which.
    Each panel is usually just a locked object, unlock them and resize the boxes.
    Peter

  • HT204394 how to rename a document created with iwork pages

    how do one rename a document created with iwork pages?

    So the "Rename" command is not supposed to work?  It is a dead link and crashes Pages.
    Where did Pages save the file that I wanted to put into the folder of related documents.  Please bring back "save as" or ask where we want the file saved.  How else can I find it later?

  • TS1702 why can I not access a new document created yesterday in "pages"?

    why can I not access a new document created yesterday in "pages"?

    Hi,
    Based on my understanding, your issue is you cannot create folder in Windows 7, right?
    Did you fix it?
    This issue might be caused by corrupted system file.
    If I am right and you haven't resolve your issue, we could try the following method:
    Run System File Checker Tool to repair your system file:
    Use the System File Checker tool to repair missing or corrupted system files
    http://support.microsoft.com/kb/929833/en-us
    In addition, please refer to this helpful thread:
    http://social.technet.microsoft.com/Forums/windows/en-US/97de8a2a-12f2-4381-a409-a78f4ae551cf/cannot-create-new-folder-in-windows-7?forum=w7itprogeneral
    Karen Hu
    TechNet Community Support

  • New session id with hosts or CNAME entry

    I am hoping someone can help me out with a problem I am having with host names and session ids. This may be something simple that I have forgotten about, so here it goes.
    Going through the jsp's below give different results, depending on the URL you use.
    If you use http://localhost:8080 or http://machine_name:8080
    The same session id will be seen on each page.
    If you use http://test_01:8080
    A different session id is displayed on each page.
    What would cause this to happen?
    Add the following files under the ROOT webapp of the default Tomcat 4.1.30 installation. Of course, I understand that storing data in servlet context like this is not a good idea, but for testing purposes it will do what is needed.
    index.html:
    Test_01
    <br><br><br>
    Call 1
    index.jsp:
    <html>
    <center>
    <%= request.getSession().getId() %>
    <% application.setAttribute( "session1", request.getSession().getId() ); %>
    <h1>Tomcat 1 Call 1</h1>
    Call 2
    </body>
    </html>
    index2.jsp:
    <html>
    <center>
    <%= request.getSession().getId() %>
    <h1>Tomcat 1 call 2</h1>
    Call 3
    <br><br>Session 1 ID:
    <%= getServletContext().getAttribute( "session1" ) %>
    <% application.setAttribute( "session2", request.getSession().getId() ); %>
    </body>
    </html>
    index3.jsp:
    <html>
    <center>
    <%= request.getSession().getId() %>
    <h1>Tomcat 1 call 3</h1>
    <br><br>Session 1 ID:
    <%= getServletContext().getAttribute( "session1" ) %>
    <br><br>Session 2 ID:
    <%= getServletContext().getAttribute( "session2" ) %>
    </body>
    </html>
    Add the following entry to your host file:
    127.0.0.1 test_01
    or
    <your ip> test_01
    or
    add a CNAME entry
    Thanks for any/all help.

    No, it has nothing to do with host names, CNAME, DNS or anything.
    The session ID is sent to the server from the browser in either a cookie header or as part of the "extra info" part of a URL with the request. If there is no session ID in either place, the server creates a new session. If there is a session ID, then it gets the session object (if it's not expired). Then it sends the session ID back to the browser with the response to that request (either as a cookie or encoded into the URLs in the page, which you have to do explicitly do for each URL). Click on a link, then the process starts again. The first time you go to a site, you have no session ID. The server just makes a new one.
    The only thing that domain names have any affect on is cookies. Cuz cookies are name/value data associated with a domain name of the server (amongst other things). The browser, for security reasons, only sends cookies in requests to servers that set the cookie in the first place. The server can't get cookies that it didn't set.
    So if you have a server running on your local machine, you can access that server in 3 ways:
    1) localhost
    2) network name
    3) domain name
    The browser can know quite easily that 1 and 2 are the same thing, and send cookies for either interchangably (not that it has to, but it seems you are seeing this happen, so...). But the browser will probably not make any assumption about 3's relation to 1 or 2. The association is generally to domain name, not necessarily IP address.
    And it's really a moot point anyway. You should not typically be accessing a server from those 3 different means within the same session. Someone connecting to your server isn't going to use anything but #3 anyway, the other 2 (definitely #1 and #2 only works on the same LAN) wouldn't make much sense. So there's not going to be this issue at all. The session ID itself has no relation whatsoever to a client's domain name.

  • Session replication at every http request

    Hi everybody
    I'm trying to use ZKoss Framework (www.zkoss.org) to develop a
    web application and deploy it in a Clustered WebLogic Server.
    The main issue I'm facing is that the "state" of the visual interface
    is stored inside the http session, and so, when node that handle
    the http request changes, the state is resetted and then the page changes,
    even if there was no user intervention.
    So I need to replicate the whole session at every http request,
    to prevent strange behaviours when the request handler node's changes.
    Do you know some settings that will force WebLogic Server to replicate the whole
    session at every http request?
    Thanks in advance.
    bye.

    Hi Marco,
    Yes, You are right But You NEED NOT to put setAttribute("key","value")...code in all your JSPs. because if the Attribute data of Session is changed then Automatically it will be replicated (only the Changed Data and not the Data which is unchanged). Even we need not to worry about replicating the Unchanged Data Again...And WebLogic will take care of ChangedData by itself. There is no other alternate solution available in weblogic to do this...Even no such similar Element available in Deployment descriptors as well.
    Actual Link is Broken http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs90/cluster/failover.html
    Any way i am copy-pasting few Lines from E-Docs (the actual link i am not able to find ..but may be u can open the cached page:
    http://74.125.153.132/search?q=cache:bxTbqJEsQTsJ:download-llnw.oracle.com/docs/cd/E13222_01/wls/docs90/cluster/failover.html+setAttribute+Session+replication+weblogic&cd=6&hl=en&ct=clnk&gl=in
    ---------------------------If you are not able to open the link then please refer to the E-Docs copy-paste content below --------------------------
    Programming Considerations for Clustered Servlets and JSPs
    This section highlights key programming constraints and recommendations for servlets and JSPs that you will deploy in a clustered environment.
    Session Data Must Be Serializable
    To support in-memory replication of HTTP session states, all servlet and JSP session data must be serializable.
    Note:     Serialization is the process of converting a complex data structure, such as a parallel arrangement of data (in which a number of bits are transmitted at a time along parallel channels) into a serial form (in which one bit at a time is transmitted); a serial interface provides this conversion to enable data transmission.
    Every field in an object must be serializable or transient in order for the object to be considered serializable. If the servlet or JSP uses a combination of serializable and non-serializable objects, WebLogic Server does not replicate the session state of the non-serializable objects.
    Use setAttribute to Change Session State
    In an HTTP servlet that implements javax.servlet.http.HttpSession, use HttpSession.setAttribute (which replaces the deprecated putValue) to change attributes in a session object. If you set attributes in a session object with setAttribute, the object and its attributes are replicated in a cluster using in-memory replication. If you use other set methods to change objects within a session, WebLogic Server does not replicate those changes. Every time a change is made to an object that is in the session, setAttribute() should be called to update that object across the cluster.
    Likewise, use removeAttribute (which, in turn, replaces the deprecated removeValue) to remove an attribute from a session object.
    Note:     Use of the deprecated putValue and removeValue methods will also cause session attributes to be replicated.     
    Thanks
    Jay SenSharma
    Edited by: Jay SenSharma on Feb 11, 2010 10:24 PM
    Edited by: Jay SenSharma on Feb 11, 2010 10:26 PM

  • URGENT: New sessions created as increasing hits/second! BUG in WL5.1 sp10?

              Hello,
              I am experiencing the same problem as mr. Rajesh Rajagopalan, only he had it with
              WL 6.0:
              http://newsgroups2.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=8925&utag=
              So when the number of hits increases, it looks like new sessions are created when
              the number of hits increases!
              Is that a bug in WL 5.1 service pack 10? I would like an answer from a BEA Weblogic
              official!
              

    Hello,
              I think that the best way is to open a case to the BEA support.
              "\"Bogdan Barzu\" Bogdan.Barzu" wrote:
              > Hello,
              >
              > I am experiencing the same problem as mr. Rajesh Rajagopalan, only he had it with
              > WL 6.0:
              > http://newsgroups2.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=8925&utag=
              >
              > So when the number of hits increases, it looks like new sessions are created when
              > the number of hits increases!
              >
              > Is that a bug in WL 5.1 service pack 10? I would like an answer from a BEA Weblogic
              > official!
              

  • Do I need to load my fonts with every page of my website?

    Hi,
    In my website I use special fonts.
    To make sure that everyone, through every web-browser, sees my fonts correct I send my fonts with the website pages to the user´s browser.
    The question is: Do I need to do this for every page the user visits or only together with the first page?
    Because in my opinion the fonts will reside in the user´s browser cache, at least till the end of the session.
    I ask you this because I want to serve my pages as fast as possible.
    Thanks,
    Dirk Detmar (I am Dutch)
    Teresina, Piaui, Brazil

    Usually you would serve a single downloadable font file (e.g., myfont.woff) and Firefox will indeed cache that.
    To see whether Firefox is using a File from cache or is downloading it again and again, you can try using the Web Console (Ctrl+Shift+k), Network tab. The status code in the left column indicates how Firefox sourced the file. For example, 200 is a full retrieve, and 304 was re-used from cache after checking for a possible update. If a file you know was loaded into the page is not listed at all, then Firefox used the cached file without checking for an update (for example, if it was very fresh).
    (Example screen shot attached.)

  • Link in emails to open the link in new tab, not a new firefox window with home page,

    Link in emails open a new Firefox window with my default home page. How do I get Firefox to open the linked web page, in an new tab, as it used to do??
    This is for Win XP, FF 17.0.1, using Outlook as mail client.

    Do you mean the results from a search via the Google search bar on the Navigation toolbar or the Firefox Google home page (www.google.com/firefox) ?
    For the Google website you can set your preferences on the Google.com page via the [http://www.google.com/preferences?hl=en Google Search settings] link at the top right.
    Results Window: Open search results in a new browser window.
    You need to allow cookies for Google (Tools > Page Info > Permissions) to save that setting, otherwise you have to repeat it.
    For the Google search bar on the Navigation toolbar you can set the pref browser.search.openintab to true on the about:config page.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • A new session creates auto

    Dear all,
    We are on Oracle 11gR2, some of our developers ran one query and it is taking huge cpu resources, I tried to kill the session but whenever I kill the session a new session starts automatically. I tried to disconnect session using "ALTER SYSTEM DISCONNECT SESSION 'SID,SERIAL#,@INST_ID' IMMEDIATE" command but here also a new session starts.
    Then I found the spid of the session and killed from OS side but a new session is still creating.
    I checked and found that the query has been running from toad and one of the developer after running the query locked his machine and went back to home.
    Please let me know how it can be solved.
    Also, what changes required from DB side or Application (Client) side to prevent such instances.
    Your suggestions are highly appreciated.
    Regards.

    877938 wrote:
    Dear all,
    We are on Oracle 11gR2, some of our developers ran one query and it is taking huge cpu resources, I tried to kill the session but whenever I kill the session a new session starts automatically. I tried to disconnect session using "ALTER SYSTEM DISCONNECT SESSION 'SID,SERIAL#,@INST_ID' IMMEDIATE" command but here also a new session starts.
    Then I found the spid of the session and killed from OS side but a new session is still creating.
    I checked and found that the query has been running from toad and one of the developer after running the query locked his machine and went back to home.
    Please let me know how it can be solved.pull power plug from PC!
    Turn the PC OFF!

  • Carrying over address info from new account created on checkout page

    Mario has written a great document on "Creating login functionality on eCommerce registration form for return customers"
    http://forums.adobe.com/docs/DOC-2529
    I used this to put a username/password at the bottom of the form for new customers to create an account. I have a question, though, is there any way to push the address info entered by the new customer into the checkout page into this new account?
    Thanks!
    Anne

    I wanted to update this since I figured out the fix:
    The fields located within the checkout page - e.g. BillingAddress, BillingCity, etc. -- do not correspond to the fields within the user's account details -- e.g. HomeAddress, HomeState, etc.
    What you need to do is create hidden fields within your checkout page which will be used to capture the billing address details from the checkout form and then copy them over to the user's newly created account.
    Here is your Username/Pass fields:
                    <label for="Username">Email Address or Create Unique Username</label>
                    <input type="text" name="Username" id="Username" class="cat_textbox" maxlength="255" />
                    <label for="Password">Password</label>
                    <input type="password" name="Password" id="Password" class="cat_textbox" maxlength="255" autocomplete="off" />
                     <label for="PasswordConfirm">Confirm Password</label>
                    <input type="password" name="PasswordConfirm" id="PasswordConfirm" class="cat_textbox" maxlength="255" autocomplete="off" />
    Here are your hidden fields:
                    <div style="display: none;">
                    <label for="HomeAddress">Home Address</label>
                    <input type="text" name="HomeAddress" id="HomeAddress" class="cat_textbox" maxlength="500" />
                    <label for="HomeCity">City</label>
                    <input type="text" name="HomeCity" id="HomeCity" class="cat_textbox" maxlength="255" />
                    <label for="HomeState">State</label>
                    <input type="text" name="HomeState" id="HomeState"  class="cat_textbox" maxlength="255" />
                    <label for="HomeZip">Zipcode/Postcode</label>
                    <input type="text" name="HomeZip" id="HomeZip" class="cat_textbox" maxlength="255" /></div>
    You'll need to implement some scripting to do the copying for you. But first you need an action to start the process. I put a checkbox under the password and username fields "Create an account for me" - The user checks it, the fields get copied and then the info is pushed to the user's account.
    Since I'm no js coder: I used Mario's extremely helpful post on "Setting the billing address to be the same as the shipping address" as a guide to creating the code. Shout out, Mario! http://forums.adobe.com/docs/DOC-2814
    Put this underneath your username/password fields:
    <input type="checkbox" onclick="CopyAddress(this.checked);" /> Create an account for me, please
    Then add your script at the bottom of the form.
    <script type="text/javascript">
    function CopyAddress(checked) {
              if (checked) {
                        document.getElementById('HomeAddress').value = document.getElementById('BillingAddress').value;
                        document.getElementById('HomeCity').value = document.getElementById('BillingCity').value;
                        document.getElementById('HomeState').value = document.getElementById('BillingState').value;
                        document.getElementById('HomeZip').value = document.getElementById('BillingZip').value;
    </script>
    Be sure to add these fields into your webform -- Site Manager-->Webforms -- before you start to customize. Just copying and pasting code into existing webforms does not work. And don't make the username and password fields manadatory. It might result in an abandoned cart for those that just want to check out as a guest.
    I hope this is useful to someone out there. It has worked great for me!

  • I don't want Safari to re-open all windows from last session; can't make it stop. Set Safari preferences to new window and new tab open with blank page, but it won't.

    P.S. Also cleared cache and History. Running OS 10.7.4 and Safari 5.1.7.

    I hate this "feature", and it is another example of Apple taking functionality (and choice) away from the user. In this article:
    http://support.apple.com/kb/HT4550
    there is a description of it.
    Resume in OS X Lion
    When you open Safari in Lion or restart the Mac, Safari automatically restores the open windows and tabs from your last browsing session, so you can continue right where you left off.
    Tip: To open Safari without resume, hold down the shift key (⇧) as you open Safari. Safari will then open with the options you selected in the "General" tab of Safari preferences, options like your homepage.
    In Mac OS X v10.6 and Microsoft Windows, you can choose to have Safari automatically restore your windows in the "General" tab of Safari preferences.
    99 times out of 100, I DON'T want to restore all the windows from my last browser session. It makes zero sense for them to take the checkbox out of the General tab of the Safari Prefs.

Maybe you are looking for

  • A few questions I really need answered!

    Hello, my name is Ryan. My Mom bought me an iPod Classic [80GB Black] and I get to open it before Christmas to put Music on it, Charge it, etc. After reading that many iPod Classic owners are having problems, I need these questions answered: I have h

  • How can I print a full page 8.5x11 photo using mg2520? My operating system in windows 8

    I am currently running windows 8 and using a canon pixma mg 2520 and cannot print full size 8.5x11 prints.  I can print 4x6 but would like to print full size pictures...please help!!!!!!!!!!1

  • BP Account Balance - Ref2

    Hi, The BP account balance report shows the Ref2 coloumn which shows the manual input details. If this field is updated or changed e.g, in the AP  or AR invoice for some reason, why is the updation or change not reflected in the account balance Ref2

  • CONTAINS clause and keywords

    We have an application which uses context indexes, and a user ran the following query today which resulted in an error: select * from paghtrd a where CONTAINS(A.NAME, 'ALL ABOUT AUTOS') > 0; SQL Error: ORA-29902: error in executing ODCIIndexStart() r

  • Using Application Alias in URL

    hi all, I wanted to use application alias name in URL of my application while running. I wrote an application alias in application definition, and tried to run it using its alias. Ir runs fine, but to my surprise when i switched to any other page exc