File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Session tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session tracking" Watch "Session tracking" New topic

Session tracking

Cristian Popovici
Ranch Hand

Joined: Apr 13, 2007
Posts: 32
Hi folks,

I need some help.
I have a web application that is running on 2 servers (lets say A and B) and has the posibility to go from server A to server B and vice versa.
My problem is that I need to keep the user logged in on both servers.
What i am trying to do is to loggin the user on node A and if a page is requested from node B then pass the credentials from node A and do a login on node B. My problem is that the session on node A is lost. Is there a good solution to keep sessions opened on both servers?

Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Do you have one application deployed to two servers or to a cluster?

Or do you have two applications deployed to two servers?

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Cristian Popovici
Ranch Hand

Joined: Apr 13, 2007
Posts: 32
Hi Roger,

I have the same app deployed on two independent web servers, no cluster and no session replication. I need to do a remote login on both servers and this has two work also if the servers are running on the same machine but different ports (say localhost:8080 and localhost:8081)

Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
Can you try to use 'persistent cookies" for this?
you can store the user details in a persistent cookie and erase it only when user does signoff.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

That's a nice URL. Thanks Sripathy

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
I agree. Here's the link:
subject: Session tracking
It's not a secret anymore!