Redirecting a session to another server


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Redirecting a session to another server

Hybrid View

  1. #1
    Carl Crosswhite Guest

    Redirecting a session to another server


    How does one redirect a session on one web server (computer A) to another
    web server (computer B) and retain all of the session information, like a
    Bean that has been instantiated (on computer A) and has session scope, etc.
    Share on Google+

  2. #2
    Larne Pekowsky Guest

    Re: Redirecting a session to another server

    In article <399a9797$1@news.devx.com>,
    Carl Crosswhite <Carlxw@ix.netcom.com> wrote:
    >
    >How does one redirect a session on one web server (computer A) to another
    >web server (computer B) and retain all of the session information, like a
    >Bean that has been instantiated (on computer A) and has session scope, etc.


    There's nothing in the JSP specification that allows for this,
    unfortunately. However, there are a few ways you could go about it.

    If both computers have access to some database, A could store all the
    session information into a table before the redirect, and then a
    servlet or JSP on B could retrieve the data and use it to rebuild the
    session. You would also need to pass some sort of ID in the redirect,
    so that B would know which data to retrieve.

    Alternately, you might be able to pass all the session information
    through the query string when you do the redirect. This would be
    pretty easy to implement if everything in the session is simple data
    like ints and strings. If you are storing a lot of objects in the
    session, this gets messier.

    Some application servers may provide functionality behind the base JSP
    spec. I think ATG's "Session Federation" allows data to be shared
    between applications running on different machines.

    - Larne
    Share on Google+

  3. #3
    Fernando Ribeiro Guest

    Re: Redirecting a session to another server


    Yes you can do it with ATG Dynamo. There is also a very good feature that
    sends your session data to a second server if the first goes down for any
    reason.

    Fernando Ribeiro
    fribeiro@bol.com.br

    larnep@canetoad.canetoad.com (Larne Pekowsky) wrote:
    >In article <399a9797$1@news.devx.com>,
    >Carl Crosswhite <Carlxw@ix.netcom.com> wrote:
    >>
    >>How does one redirect a session on one web server (computer A) to another
    >>web server (computer B) and retain all of the session information, like

    a
    >>Bean that has been instantiated (on computer A) and has session scope,

    etc.
    >
    >There's nothing in the JSP specification that allows for this,
    >unfortunately. However, there are a few ways you could go about it.
    >
    >If both computers have access to some database, A could store all the
    >session information into a table before the redirect, and then a
    >servlet or JSP on B could retrieve the data and use it to rebuild the
    >session. You would also need to pass some sort of ID in the redirect,
    >so that B would know which data to retrieve.
    >
    >Alternately, you might be able to pass all the session information
    >through the query string when you do the redirect. This would be
    >pretty easy to implement if everything in the session is simple data
    >like ints and strings. If you are storing a lot of objects in the
    >session, this gets messier.
    >
    >Some application servers may provide functionality behind the base JSP
    >spec. I think ATG's "Session Federation" allows data to be shared
    >between applications running on different machines.
    >
    > - Larne


    Share on Google+

  4. #4
    Ashutosh Narhari Guest

    Re: Redirecting a session to another server



    What about serializing the session object and passing it on? [Using sockets,
    or using servlets themselves:binay streams?]

    Share on Google+

  5. #5
    Larne Pekowsky Guest

    Re: Redirecting a session to another server

    In article <399cce92$1@news.devx.com>, Ashutosh Narhari <none@none.com> wrote:
    >
    >What about serializing the session object and passing it on? [Using sockets,
    >or using servlets themselves:binay streams?]


    Hmmm, that's clever. You would have to make sure that the session
    gets to the second machine before the user does, but that shouldn't be
    too hard to arrange. And you would still need some way to attach the
    user to the session once they get to the second machine, but all you'd
    need here is an ID.

    - Larne






    Share on Google+

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 05:14 PM
  2. Accessing MySQL data from MS SQL Server 2000
    By Andy H in forum Database
    Replies: 8
    Last Post: 10-04-2005, 02:27 AM
  3. Access to SQL server
    By Nate in forum Database
    Replies: 29
    Last Post: 05-09-2001, 11:04 AM
  4. Changing Server Name
    By Levi Nkata in forum Database
    Replies: 3
    Last Post: 04-11-2001, 10:31 AM
  5. Replies: 4
    Last Post: 12-10-2000, 04:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center