Maintaining Session State

Hello,
Does anyone know how to maintain session and application variables through server restarts? I want to be able to shutdown and startup my Tomcat server without having the users lose their session and application variables (and consequently, their data and login state).
Any ideas?
Thanks!
-David

I dont think its possbile since stopping and restarting gets new sessions. Only way that I would know would be to use cookies.
But then again i dont like the idea of saving passwords in cookies

Similar Messages

  • Problems with maintaining session state using mod_ose

    I am using 9i AS(version 1.0.2.0) and oracle 8i(version 815).
    Because i need to maintain client sessions for my application, I
    have activated mod_ose(for stateful session). As suggested in
    the oracle documentation, i created a package containing
    variables for which state needs to be maintain per client. The
    state is maintained by the app server but it is not maintained
    properly. All the new clients that connect to the app server
    share the same session variable values. If I change a package
    variable value from one client, other clients take the same
    value.
    Any solution?
    Suggestions are most welcome.
    Thanks in advance.

    We installed oracle9i AS on solaris, configured OSE and the
    problem is not occuring now. Not sure whether its solaris that
    worked or 9i AS had some problem on NT machine earlier.
    Regards,
    Sharad

  • Jaxm - Maintaining Session State

    Hi,
    I have the following problem:
    My client dispatches jaxm-soap-messages to a java-servlet using the reference implementation of sun (wsdp). For each time I use the same SOAP-connection object. The problem is, that the servlet opens with each inquiry a new session. How can I maintain the session ( for example setting a cookie in case of http as the protocoll)? Is there a mapping between parameter in soap-header to http-header ?
    Greetings,
    Zubow

    Hi. I ran into the same situation a while back. I'll tell you how
    I resolved the problem.
    You have to build your own handler class. Extend the javax.xml.rpc.handler.GenericHandler class. Implementing the handleRequest(MessageContext msg) method.
    1 public boolean handleRequest(MessageContext context)
    2 {
    3 try
    4 {
    5 SOAPMessageContext smc = (SOAPMessageContext)context;
    6 SOAPMessage message = smc.getMessage();
    7 MimeHeaders mimeHeaders = message.getMimeHeaders();
    8 if(mimeHeaders.getHeader("Cookie")==null && getCookie()!=null)
    9 {
    10 mimeHeaders.setHeader("Cookie",getCookie());
    11 }
    12 }
    13 catch(Exception e)
    14 {
    15 throw new JAXRPCException(e);
    16 }
    17 return true;
    18 }
    19 public boolean handleResponse(MessageContext context)
    20 {
    21 try
    22 {
    23 SOAPMessageContext smc = (SOAPMessageContext)context;
    24 SOAPMessage message = smc.getMessage();
    25 MimeHeaders mimeHeaders = message.getMimeHeaders();
    26 if(mimeHeaders.getHeader("Set-Cookie")!=null && getCookie()==null)
    27 {
    28 String[] headerValues = mimeHeaders.getHeader("Set-Cookie");
    29 String cookie = headerValues[0];
    30 if(cookie.indexOf(";") >= 0)
    31 {
    32 cookie = cookie.substring(0,cookie.indexOf(";"));
    33 }
    34 setCookie(cookie);
    35 }
    36 }
    37 catch(Exception e)
    38 {
    39 throw new JAXRPCException(e);
    40 }
    41 return true;
    42 }
    The overall concept is to handle the soap message before it goes back
    to the server. You need to add the COOKIE header variable set to JSESSIONID=your session id
    to the message header before every request goes to the server. The handleResponse looks for set-Cookie variable that comes back from the
    very first request.
    Hope that helps.
    Mike
    first request.

  • Adobe Air and maintaining session state

    OK, here's a short run down. I'm working on an Air app per client  request. It's a tight time frame so I'm going the HTML/JavaScript route  since that is what I know. I've only been digging into this for a couple  of days, read a handful of tutes and articles but I just haven't found  this yet.
    What are some methods for maintaining some session-like variables throughout the app (since it will have multiple html "pages")?
    I've seen where some are using an encrypted local store, not sure I  really want to do that as this app will be in a public place. I suppose I  could use an encrypted querystring - not sure of the implications  there. What else is there? I've also played around with SharedObject but can't seem to persist it between pages.

    I dont think its possbile since stopping and restarting gets new sessions. Only way that I would know would be to use cookies.
    But then again i dont like the idea of saving passwords in cookies

  • How to maintain session state in APEX

    Hi friends,
    I have a form with two page items and two buttons( submit ----->submits the page and inserts a record, cancel ------>redirects to other page)
    *)p1_A
    *)p2_B
    If i entered a value in the page item p1_A and p2_A, and after that without pressing "Submit" Button im pressing "Cancel" button means it is redirecting to the other page and again if i came back to my form page means, the values that i entered in the page item
    *)p1_A and p2_B is disappearing.
    Is is possible to maintain a values entered in the page item (p1_A and p1_B) without submitting it and navigating to some other page.
    Brgds,
    Mini

    Hi Peter,
    Thanks for the reply.
    Generally i have two page 1 and page 2
    page 1 contains 2 page items
    <li> P1_A
    <li> P1_B
    in the page 1 itself i have a list called po order.
    If i clicked that list po order means, it is navigating to the page 2. My page 2 also contains below two items and a button BACK
    <li> P2_A
    <li> P2_B
    After i entered the values in P2_A, P2_B and if i press the back button means, it is redirecting to the page 1. Again if i click the list po order means it is navigating to the page 2 but the values that i entered in P2_A, P2_B is disappeared.
    Whether it is possible to maintain the values that i entered in the page items P2_A, P2_B soon after redirection. Mainly im not submitting page 2, just redirecting back to it.
    settings to do that at the Button settingsAnd u said of doing that settings in the button that i have in page 2.
    yes i found the option set items with the values
    set item: P2_A  with values: &P2_A.
    But it didnt worked. Am i wrong.
    Kindly help me with this issue peter.
    Brgds,
    Mini

  • Session state - Whats the big deal?

    What is the equivalent of HTMLDB's "session state" in other peer environments, like, for instance, ASP/ASPX pages?
    There, you would just define a bunch of variables and use those on the page, right?
    How does the fact that HTMLDB's "variables" are stored in the database benefit me? All I care about is being able to read/write my "variables" from various points in my application.
    Thanks

    Vikas,
    Session state needs to be maintained somewhere. Then, on a subsequent page view/submission, you are essentially reunited with your session state. This is applicable to almost all Web technologies.
    Most technologies persist session state in application server middle-tier memory, which is very finite (.NET supports configuration of both, memory or database). Think about it...if you have 2GB RAM on your middle tier, how many "concurrent" sessions could you support maintaining session state in memory for all your users? What type of elaborate mechanism would you have to employ to ensure you don't exhaust middle tier resources?
    I've built/used/monitored real-world applications built using HTML DB, which would have over 6,000 distinct users in the peak hour, yet at any given split microsecond, there were no more than 8 - 10 active database sessions. In an alternative architecture, how much middle tier memory would it take for you to support 6,000 distinct user sessions in an hour? How long before you start expiring these sessions?
    Joel

  • Session state in websheets?

    Hi guys,
    I fear that it is not possible, just wanted to make sure.
    I haven't found a way to maintain session state. For example to include a combo box to store a selection in it (e.g. a Project identifier).
    Also, it looks like we cannot reference any internal variables like &APP_USER., &APP_ID., &APP_SESSION., etc. either. Am I wrong or is this a true limitation?
    Thanks,
    Dietmar.

    You are on the right track to use caching for shared state. Where caching gets confusing and temporal (as you have seen by different
    articles on different dates) is that what used to be called Azure caching is now called Windows
    Azure Shared Caching. In October 2012, Windows
    Azure Caching was released (as per the article you found) and is role (instance-based as opposed to shared) caching. Use the
    'Caching' and not 'Shared Caching' as shared caching does not perform that well, is expensive, and generally replaced by (non-shared) caching. If you need it, shared caching is still available in the old Silverlight portal, which you get to by selecting 'Previous
    portal' on the drop-down menu on your name. Other features, such as reporting services, are currently only available in the 'previous portal'.

  • Saving session state in database table rather in websever for Ordering App

    Hi all,
    Ours is a ordering application (telecomm) domain.
    Currently, we are storing user sessions data (Order shopping cart session data) in middle tier (iPlanet web server) which inturn consumes lot of memory resources.
    Shopping cart could be in MBs if order is a huge business order.
    So in order to not to overtax web server (middle tier), we are thinking of storing session data directly in a database table to relieve the overhead on web server and make use of database for storage.
    I read that APEX (html db) is already using this "single metadata table" approach for session data management. But we are not using HTML DB to really look into.
    Can some one advise how to go about storing "user session data" directly in a "database table" for both storage and retrieval purposes instead of storing it in "webserver".
    How does this "metadata table" structure looks like. Is it more generic ?
    Really appreciate your time and help/suggestions.

    Joel,
    Thanks for your response. sorry, i meant to say that "the current application does not use APEX but will look into it".
    To build this is an utterly non-trivial exercise. Oh - it may not be so hard to save session state to a table when you POST a page. But you may want to reference this in many places, and it's a question of can you change all of these references to indirect references from session state in your application.In order to free up the load on webserver, we want to maintain session management in database. Could you please explain the above little more :
    How do we maintain the "user session" with "database table" ?
    Do we need to store "session data" at java object level or by page in database table ? How does the structure of this "metadata table" looks like.
    Thanks for your time.

  • Maintain folder state in struts in a JSP

    Hi
    I had a requirement of displaying a group of folders in very large numbers in the corresponding Folder hierarchies in a JSP. I acheived it using Ajax calls. This is the set of steps we have adopted
    1. When ever a user clicks a Open/Close/add file/delete file/add folder/delete folder to a folder, using Ajax we retrieved the whole result set into a XML, applied some styles to it(XSLT) and finally we make them displayed in the jsp using object. innerHTML = processResponse()method in Ajax.
    2. while we dispay this entire Library tree in the JSP, we maintain the state of the folders in a map(Which contains the folder id's which are in expanded state) and that map is being attached to a session and thus we store the each FolderInfo and finally display the tree using XSLT.
    3. I notice the state is always getting disturbed every time I perform the above mentioned actions, I see the entire tree with all the folders in expanded state(as the default value of the isExpand variable of the FolderInfo object is true.). Is this the correct way of preserving the Library Tree's state. If not so , please suggest an improvements of the existing process or an alternative one.
    This process involves the role of map in the session across alll teh DAO and business layers and finally to the Presentaion layer.
    Thanks

    Yes, there are two ways (at least) to do that:
    1. Map<String, ClientData> where String is the result of RemoteServer.getClientHost(). Use this in the case where there is only one instance of your remote object.
    2. Allocate a remote object instance per client. I call this the Remote Session pattern. You make it so that the thing you look up in the Registry is really a factory, and your clients call a method on the factory to get their own instance, which is basically a remote session.

  • Session State Replication of Referenced Objects

    Here is question on Clustering and Session state replication:
              Scenario:
              Consider two Session Objects A and B.
              Object A has-a reference to object B.
              So whatever changes done to Object B is reflected in Object A.
              In-memory Session replication happens on every HttpSession.setAttribute() call.
              The question is will the two session objects(A and B) be replicated to the other cluster and will still maintain the reference relationship or will they be two separate objects with same data (in different memory locations).
              regards,
              Jaiganesh

    Ok, I have been meaning to dig into session replication in a bit more detail and your question is a good excuse to do it!
              First stop the docs:
              Bea Docs
              The bits that jump out are under:
              Programming Considerations for Clustered Servlets and JSPs
              1) Session Data Must Be Serializable, so both your objects are serializable.
              2) 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.
              >Will the reference as shown in the step 3 will be >maintained after replication on the other cluster ?? I >guess not!!
              I don't understand "on the other cluster" There is normally one cluster made up of a few servers. The session state is maintained on one primary server and a secondary server. So you have aObj.a2 = bObj, from the docs I would understand that at the momment you called session.setAttribute the aObj and all its fields provided they are seriliazable will be replicated in Mememory.
              >There the aObj and bObj stored in the two different >session objects will not have a reference relationship >in other words if i change bObj on the other cluster >will the reference a2 of aObj be able see it ??
              This is testing the limits of my understanding, but would have thought if the objects are in different sessions they should not be able to reference each other in the manner I think you are suggesting, so if I access aObj.a2 (an instance of bObj) and changed it in one session it should not affet any other bObj unless bObj is a singleton....I think!
              What say you?

  • Regarding maintaining session in flex

    Hello,
              I am developing a flex application which is using jsp for database connectivity. I am using HTTP request for connecting to jsp page and passing and retrieving parameters. Now I wanted to ask how can I maintain session in flex so that I can know which client has logged into the system and on the basis of that can assign privileges to the client. Is it possible in flex and how?Reply needed urgently.
    Thanks in advance.

    Hi a.bhavika,
    There is not specifically any session management in Flex as it runs everything on the client side if at all you want to mainatain you can maintain it on the server side. ...and I think for your case I dont think you need any session managemenet as at the time of login only you can identify which user has logged in to the syetem and based on the user logged in you can load all the previleges of that particular user in the Flex application.
    Check out the links below for your understanding...
    http://www.forta.com/blog/index.cfm/2006/9/24/flex-and-session-state-management
    http://www.assembla.com/wiki/show/romoz/Session_Management_in_Flex
    Thanks,
    Bhasker

  • Manage session state in web service (web tier)

    Hallo, is anybody know how to manage session state in web service application?
    I 'm building an application using Sun Java System Application Server 8.1, and using web as web service end point.

    By default webservice is a stateless, but there is a option where you can specify the Request scope session/Reqeust/application
    You can use the above and have to make a change in the client side to particiapte in the session.
    Or
    In the server side you can have webservicesession tracker class...very first time when user is authenticated, you generated a unique token and send them with request....and from there on client should send the same token for further request.
    Token is checked with your webservicesession tracker class which maintains all active seesions. Session tracker class can also inactivate the token session if there was no request from the user for a certain period of time....
    Its similar to HttpSession class ( i call it as WebServiceSession.)
    If you need more help on the webservicesession class...pls let me know.

  • Configure Session State?

    Is there any equivalent of the "Configure Session State" page from MOSS 2007?
    ie. http://<server>:<adminport>/_admin/SessionStateAdmin.aspx
    So far trying to install our webparts on SP 2010 has failed misserably. They install fine on out of the box MOSS 2007.
    I've managed to get over the session state problem by hacking the web.config file but that's not particularly desirable (as it wasn't required on MOSS). Now we've come across a viewstate problem as well which I haven't yet fixed.

    There's a new State Service in Microsoft SharePoint Server 2010, that maintains temporary state information for IPFS.
    Okay. But it doesn't seem to enable normal ASP.NET state like it did in 2007. This will probably cause lots of issues when migrating custom webparts and apps (or at least any using session state).

  • Maintain session

    I have a client side java program running. It is to comunicate with a web server using HTTP. How do I maintain session in my java program in the client machine. I have no access to the web server.
    java.net.URL and java.net.HttpURLConnection are not maintaining session, tough allow me to transact. It creates a new session for every hit.
    help!!!
    Trijoy
    [email protected]

    Hello Darted,
    I have a small task ahead. My boss hates logging in userid and passwords every time he logs ont a site, which he dose 10-15 times a day. Due to session timeouts, he has to repeat the login process.
    The requirement is that, I should have a process running, that will maintain the session throughout the day by hitting the URL every 18 mins or so..(session timeout is of 20 mins), and when he writes the URL the old session is maintained.
    The process is such that it sends data over http to the server. The data is accepted only for the live and valid session. At present we are sending it through a form (post). If the state can be maintained in the java applet, swing or whatever, we will remove the HTML form and will automate the process of form sending.
    I am looking for a mechanism which emulates a browser, i.e. maintain the session till it gets time out or browser is closed.... only I want to avoid using a browser and refreshing it every time and want to implement it thru java so that I can have control over it.
    Thanks
    Trijoy
    PS. Any help in design, source code, suggestion is highly appreciated

  • Maintaining the state between http requests

    All of the SDK examples perform a login followed by a logout.
    The Content dhtml applets require a login, after which the login is no longer required until either the session is closed or the timeout period has expired.
    In the SDK java examples, WsConnection is used to perform the login.
    Using the SDK, how do I maintain the session across http requests?
    How do I determine whether the session has timed out?

    Session state across http requests is automatically taken care of when you use the classes like WsConnection or ContentServicesSession in the sample tool kit. The session is valid until the time out happens(due to inactive session) or the client issues a logout command. It is possible to keep the session alive for longer time by using SessionManager.keepAlive() for long running transactions.
    To check whether the session is available or not you can issue a simple command like FileManager.resolvePath("/",null). If this call throws a session not connected exception ,you know that the current session is invalid.
    Hope this helps,
    Ravikiran

Maybe you are looking for

  • Deactivate Goods Receipt in PO

    How we can deactivate (only display should be allowed) Goods Receipt , Invoice Receipt, Non valuated GR in Purchase Order ?

  • Font not showing up in Photoshop CS4 for Windows

    I have fonts that I've installed in both my Windows XP and Windows 7 PCs.  They show up in the Control Panel - Fonts and open, they show up in Word, but do not show up in Photoshop CS4.  I see in the CS4 Mac forums that there is a way to register a f

  • WRV200 Web UI Inaccessible

    Is the web UI crash still a known issue in Firmware version 1.0.32.2? The web ui on my WRV200 intermittently becomes inaccessible.  It usually dies within a day or two, but sometimes it will stay up for a couple weeks. The router still responds to pi

  • Intel iMac 17 inch replacement lcd???

    hello all, i need a new lcd for my 2006 c2duo imac 17 inch, the lcd is a LM171w02-TL B2 but im have trouble finding one anywhere for a sensible price. Ebay maybe the last option! Does anyone know if a compatible PC monitor lcd would fit? I know that

  • Code for currency translation

    All records from ECC will be translated using the daily exchange rate to be aligned with ECC. Created a  new key figure with the local currency and added to cube, no rules set for this keyfigure. Need to get the daily exchange rate for this field usi