Context session sharing

Researching a lot in this topic, I found out various ways to share session information between differentes contexts in a Tomcat 5 Container, including files pseudo-sessions, URL rewriting, and even an context configured in Tomcat with a shared option set to true.
The URL rewriting sounds the simplest solution, but I could'nt make it work. Even adding the ;jsessionid=key in the URL, the session doens't existis in the another context, what conforms to the documentation I'd read.
So, how is possible to share a session between diferents contexts using URL rewriting? Or, the cleanest way to share a login made by an user in a context for all others context's?

Sharing session context between WebApp is not possible with OC4J including OC4J 10.1.2.x. (I didn't test with the new OC4J 10.1.3)
According Servlet Spec 2.3 (SRV.7.3 Session Scope):
HttpSession objects must be scoped at the application (or servlet context)level.
Some Application Servers implement this non compliant feature but I think this is a really bad practice (but sometimes usefull)
Jean-Marc --

Similar Messages

  • Session Sharing between Webapps

              Hi everybody,
              I have read that session sharing between webapps is possible since Wls 6.1 using
              the same name
              for a cookie in the webapps.
              I have created a webapp named myPortal (for example) and a second named Navigation.
              The first webapp
              includes content of the second webapp
              After deploying the webapps in WLS and printing out the sessionid in each of the
              webapps, I found out
              that unfortionally the sessionid in the two webapps are not identical.
              My Question is: Is session sharing possible, or should I create a workaround?
              Here is my environment:
              WLS 6.1 on SUN running in developmentmode
              two webapps, deployed as .war file and/or as .ear file
              Cookie Name is configured to be identical in the two .war Files
              Regards,
              Ed
              

    Search this newsgroup for a reply post on this by me. I incorrectly went down the
              primrose path on this one, too. I was corrected by Cameron Purdy. I did a bunch of
              impirical research on this and came to the same conclusion you have come to. The spec
              doesn't require it and, in fact, says that separate webapps have separate contexts, so
              they don't share sessions, even if the cookie is the same name.
              Bill
              Eduard van den Bongard wrote:
              > Hi everybody,
              >
              > I have read that session sharing between webapps is possible since Wls 6.1 using
              > the same name
              > for a cookie in the webapps.
              > I have created a webapp named myPortal (for example) and a second named Navigation.
              > The first webapp
              > includes content of the second webapp
              > After deploying the webapps in WLS and printing out the sessionid in each of the
              > webapps, I found out
              > that unfortionally the sessionid in the two webapps are not identical.
              > My Question is: Is session sharing possible, or should I create a workaround?
              >
              > Here is my environment:
              >
              > WLS 6.1 on SUN running in developmentmode
              > two webapps, deployed as .war file and/or as .ear file
              > Cookie Name is configured to be identical in the two .war Files
              >
              > Regards,
              >
              > Ed
              

  • Session sharing again

    Hi all,
    A problem with a slight difference from the one just posted by vakkanti about http-session sharing.
    In our servlet/JSP application the users can of course open a new window within their browser.
    The problem is that both windows are now using the same HTTP-session because the other session has not yet been invalidated and that gives problems in the use of session variables etc.. How can I force that the the new window is using a new session? Or otherwise at least deal elegantly with this problem. It must be a well known problem I think.
    Regards,
    Ronald

    Hello Ronald,
    I do not thinnk that is a 'J2EE issue' in the sense this is the way browser reacts. When you open a new window you are in the same context in term of cookie, session, etc etc. All container will react the same way with a new opened window.
    The only way that I now to have multiple windows and different sessions is:
    - on Internet Explorer and with creatin a new process by running IE (Clicking or run command) not with the File>New window , or any links.
    Could you explain why you need multiple session in different window? What is the businness requirement of your application? (we may be able to find a work around, since the behavior your expect is not supported by browsers)
    Regards
    Tugdual Grall

  • Load balancing and session sharing

    Hi,
    in my company we have the following situation:
    We have 2 instances of the same web application on differend servers.
    An external load balancer (Alteon) routes the requests to these instances.
    The problem:
    If one instance is shutting down, all the sessions of this app are gone. These users has to login again.
    The question:
    Is it possible to avoid this?
    Is is possible to keep these session, so the users don't have to login again?
    Maybe with a kind of session sharing between these 2 instances?
    using:
    oc4j standalone - 10.1.3.1
    OS: Windows
    thank you
    Marcus

    The solution:
    Multicast IP replication is the default replication protocol used in a standalone OC4J installation
    see: http://download.oracle.com/docs/cd/B32110_01/web.1013/b28950/cluster.htm#BABBHGHJ
    -> Configuring Multicast Replication

  • How to prevent session sharing ???

    I am getting a problem when i access my application with different logins from same machine ( same browsers ) ,
    then old login session is updating with new login session,
    how can i prevent this session sharing?
    thanks in advance

    What's probably happening is that you use file cookies (cookies are stored in your file system).
    1. You log in from browser 1 as User A. The server sets a session cookie on your file system.
    2. You continue to work from browser 1. The session cookie gets sent in every request and all is fine.
    3. Now you open another browser and log in as User B. The server sets a session cookie identifying you as User B on your file system.
    4. This overwrites the cookie that was set earlier that identified you as User A The concept is that you can have only one cookie from a server for a specific purpose (session identification in this case)
    5. When you go back to browser 1 now and access the site, the second cookie gets sent (the one that identifies you as User B) and you are logged in as User B now.
    ram.

  • Session sharing among multiple WAR files inside an EAR file

    Hi all,
    Is there a way where I can share my session object among multiple WAR files which are inside an EAR file?
    Please suggest.

    r035198x wrote:
    Some application servers (like Weblogic) allow to configure session sharing when you deploy the application.Sidenote: which is completely against the servlet spec.

  • Does Session Sharing feature provided by SAP Net Weaver application server

    Hi All,
    Session Sharing is an additional feature provided by Tomcat , Weblogic  and Web sphere application servers.
    Is this feature available in  SAP Net Weaver application server?
    Brief description on Session Sharing
    Session Sharing  specifies whether HTTP sessions are shared across multiple Web applications.
    In Weblogic this is an optional feature customizable in weblolgic-application.xml
    Sample weblogic-application.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-application xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session-descriptor>
          <persistent-store-type>replicated_if_clustered</persistent-store-type>
          <sharing-enabled>true</sharing-enabled>
    </session-descriptor>
    </weblogic-application>
    session-descriptor (Optional Element ) - Specifies a list of configuration parameters for servlet sessions.
    sharing-enabled (Optional Element ) - Specifies whether HTTP sessions are shared across multiple Web applications. Default value is false.
    Thanks in advance.
    Regard's
    Srikanth
    Edited by: Srikanth A on May 14, 2010 7:36 PM

    Hi,
    You cannot set up Garbage collection frequency. it is internally handled by Java when the Heap size is filled up.
    You can always fine tune your server to SAP recommendations.
    Note 723909 is a good starting point.
    Also other checks include that you use SAP recommended Java versions, OS patches and also that you have enough physical memory.
    Thanks & Regards,
    Vijith

  • HTTP session sharing

    Hi,
    We have a need for session sharing among the different JVMs and have been trying the application cluster functionality with zero luck. Now we are thinking of looking into coherence because by reading the documentation we came to know this is something we could accomplish it. Since being a very new on this, have anyone done this and if you have can we get some information on how to do it. We will really appreciate your help on this.
    Thanks,
    Raj

    To better understand the background of your root problem,
    1) which Application Server product are you using?
    2) the term "clustering" may mean different things to different App Server implementations. Does your reference to clustering also mean "Http Session Replication" has been specifically enabled, or that by simply clustering JVMs you expect this to happen automatically?
    3) is access to the session needed by the same web app or different web apps in the JVMs?

  • Session sharing among different web application under Oracle AS

    Hi,
    I'm looking for some information on web application session information sharing under Oracle AS10.1.3.
    any pointers are highly appreciated.
    Thanks,
    Narasimha.

    Hello,
    I see that you have duplicate your post in different forums, Session sharing among different web application under Oracle AS10.1.3.
    Regards
    Tugdual Grall

  • What is Cross Context session.

    HI,
    What is Cross Context session?
    Iam using Tomcat .
    pls help
    Thanks in advance
    arvin

    Where have u heard about that concept? I don't know it.
    I know about "crossContext" feature of Tomcat which means other applications can gain access to ServletContext of your application (by using the appropiate API), but did know nothing about "cross context sessions"...
    Sorry.

  • Session sharing/reuse issues

    Hi,
    I have multiple application set-up using session sharing within the workspace.
    Technically all works fine, however it does not play nice with user behaviour.
    Example:
    Users logs into APP_ID:100. Since he isn't authenticated yet, he provides user/pass and the APP_SESSION is authenticated.
    Now if the user switches using to another application (using a link provided in application 100) he gets redirect to APP_ID:101:APP_SESSION all is fine.
    The session is already authenticated, the application shares the session and the user gains access to app 101 without having to authenticate again.
    All's fine!
    However users don't behave they way. Instead of using an easy link in the application. They will use their own bookmark or type in the url for app 101 manually.
    That way the next application is either called with f?p=101:1:[SOME OLD SESSIONID FROM BOOMARK] or f?p=101 (with no further page or session info)
    In both cases instead of using the already authenticated session apex spawns a new session, which of course isn't authenticated yet thus forcing the user to authenticate and come complaining they have to login again.
    Similar behaviour problems exists when the user opens a browser and tries to open both applications in each in a tab next to each other.
    Both tabs fetch there own initial session id and start writing it to the same cookie each in turn invalidating the other tab's session.
    These can lead to some fanatic ping pong actions. Thus it's impossible to open 2 applications sharing session in the same browser.
    Is there any remedy for these situations?
    Can apex be as smart as for instance first trying to resume the session stored in the cookie and only if that session is invalid, start a new session?
    Thanx
    apodictus

    Hi,
    I'll just try to answer one of your questions..
    apodictus wrote:
    Similar behaviour problems exists when the user opens a browser and tries to open both applications in each in a tab next to each other.
    Both tabs fetch there own initial session id and start writing it to the same cookie each in turn invalidating the other tab's session.
    These can lead to some fanatic ping pong actions. Thus it's impossible to open 2 applications sharing session in the same browser.
    Is there any remedy for these situations?
    Can apex be as smart as for instance first trying to resume the session stored in the cookie and only if that session is invalid, start a new session?The brilliant feature you want to get rid off is session sharing. Not the one you describe, but the one Microsoft implemented in IE7->
    All developers have this kind of problem, so they naturally create a way to turn them off.
    And when using ie you have two command line switches..
    iexplore.exe -noframemerging
    iexplore.exe -nomergehttp://msdn.microsoft.com/en-us/library/ee330728%28VS.85%29.aspx
    I'm sure that Firefox and Chrome have a simelar set of switches/hidden settings...
    or just use private browsing...
    /kenny

  • Session sharing acrossed ears

    Is it possible to share a session across multiple EAR's? I have successfully shared sessions across multiple WAR's in a single EAR by using the session scoping and session path information.

    According to the spec, Sessions aren't suppose cross WARs. However, with IBM's Websphere, you are able to "enable" "Shared Session Context" across multiple WARS in a single EAR and provided the virtual domains for each WAR are the same.
    This is nice because it gives a developer the flexibility to logically breakup a large site into multiple war applications under the same EAR without having to worry about session management. For example, you can have a BrochureWAR, LoginWAR and a MemberForumWAR, MemberPaymentWAR, etc... all in the same EAR. The LoginWAR would put a UserObject into Session and the other MemberWARs could use it. Otherwise you would have to use the dreaded EJB solution or roll-your-own webservice state machine.
    As a quick note, be sure that any Object you put into the Shared Session Context is loaded using the Server's classpath and not the WAR's classpath. If you don't and you load a FooObject from WAR1 lib into session, a read from Session by WAR2 will throw a ClassNotFound error because of differing classloaders. Know what I mean?
    Now with all that said, I want Shared Sessions across EARs (obviously for WARs of the same domain of course). In this way, I would be able to completely remove/upgrade certain area's of a Very Large webappliction without effecting other areas for example: someWebSitesMemberPaymentEAR without effecting someWebSitesMemberForumEAR. Of course I could achieve this with all webapplications calling some Stateful WebService or EJB thing backend too but GOSH... thats alot of work for Session Management across EARs. Where's the easy button?

  • Session Sharing on Different Servers

    Is it possible to access the data of a session created in one server
              instance from a different server instance, without necessarily
              clustering? And if so - how?
              For example:
              User has a session created and some data stored on session of
              server1.domain.com.
              User then goes to server2.domain.com and accesses data of session
              created on server1.domain.com.
              TJS
              

    hi!
    you look them up, just the same way as at the same container. you just have to specify the location of the JNDI, where the beans should be looked up (environment settings).
    Hashtable env = new Hashtable();
    // com.evermind.server.rmi.RMIInitialContextFactory IS IMPORTANT
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin"); // user
    env.put(Context.SECURITY_CREDENTIALS, "admin"); // pwd
    env.put(Context.PROVIDER_URL, "ormi://OC4J2/BeanAppl"); //location + applname
    Context context = new InitialContext(env);
    SBHome sbHome = (SBHome)PortableRemoteObject.narrow(context.lookup("SB"), SB.class);
    SB sb = SBHome.create();
    hope 2 help you ;o)
    ed

  • Session sharing between war files ???

              It seems that web-apps run in their own context, eg. are loaded by
              seperate classloaders. This means that a user will be prompted to log on
              to each web-app.
              Is it possible to share a session (eg. have a single login) for multiple
              web-apps (war-files) ???
              /Peter Reetz - Kapow
              

    A Web Session is defined for a Servlet Context. The Javadoc for HttpSession says the following:
    "Session information is scoped only to the current web application (ServletContext), so information stored in one context will not be directly visible in another."
    So, session is designed to work that way. You should be having separate web applications since you said you have separate JVM's. So, to workaround this, you can use a database to store session objects based on the session id of a user thus maintaining unique and proper data for each user. This will make the application a little slower compared to inmemory solution, but will make sure that proper data is served in a clustered environment too since session data is stored in the database and each bean/object do not maintain any state as such so that more number of users can also be supported. This will return proper data in case the user gets to a different app server in the cluster for high-availability and also as fail-safe.
    We implement this in our application that uses a cluster of 4 app-servers as it has many applications and has to support large number of concurrent users using any of these applications with a single sign-on.
    Amar.

  • Session Persistance / Session Sharing

    I have 2 administration servers that share sessions thru a NFS mount file system. Is that allowed ? It seems to work most of the time, except for some instances where users are being kicked out because of invalid sessions/because the server could not find the sessions. Why does this happen ? Is it possible that both the admin servers create sessions with same session id's (once in a while )
    Please shed some light.

    Hmm, is there really no other way - it sounds like a maintenance nightmare to update the server lib every time I deploy a new version of one of the apps. Anyways, in both apps I use JNDI to look-up the EntityManager, doesn't that mean that I share the same persistence unit? All I really want to achive (I think) is to share the TopLink session between those two apps (and the cache will be shared consequently). What about manually managing the TopLink session (retrieve/invalidate) wouldn't that help?
    On a different front - I played with the TLE cache settings a little bit to see when/what SQL queries are actually executed and I was quite surprised to see that even with the 'Full' caching enabled SELECTs/UPDATEs are executed instantly whenever merge/find operations are executed (I'm using MySQL and the query log). Is there a way to defer those to put less load on the SQL server?

Maybe you are looking for

  • Tranferring XML data to the B1 System

    Hi, Iam very new to the B1 system.. Iam looking to transfer the data from the XML file to the B1 system. to make it clear, the requirement is i have a purchase order coming from one system and it is saved in the server..the data in the XML file will

  • Display data from a virtual InfoCube

    Hi experts, When I tryed to display data from the virtual InfoCube 0FIGL_V40, I've got a dump. Please help me to solve this problem.

  • Premier Pro Shuts Down when trying to EXPORT

    I am a new editor, only at it for a couple month now. The problem I have is when I attempt to export, Adobe closes without warning. I have exported in the past, what I do is, set a work area or just highlight a clip, go to FILE: EXPORT: ADOBE MEDIA E

  • HT3235 HP external monitor

    What adaptor do I use to hook up my new MacBook Pro with an HP monitor

  • Seeking another pair of eyes - MSI H77MA-G43 + i5 2500K

    Hello everyone, I have read the CPU compatibility sticky and I think I have come to a conclusion but I wanted to run it past a larger group. I have a MSI H77MA-G43 that won't POST (sits in a power cycle "infinite loop") and I *believe* it is possible