This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Servlets and the fly likes Session Id problem in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Id problem in servlet" Watch "Session Id problem in servlet" New topic

Session Id problem in servlet

harshad kadam

Joined: Mar 19, 2011
Posts: 8
I have one simple login service implemented in a servlet.

here i get the session id for this servlet context. To authenticate user later in other service, i have other method which matches the session id generated at after login, with currentSessId = request.getSession(false).getId();

where, validateSession method matches currentSessId with sessionId dat was generated at login time (which comes through URL request).

This approach is working fine when i access the this servlet through ip, means{%27username%27:%27admin%27,%20%27password%27:%27admin%27}

But when i access application through domain, it is creating new session Id every time i make the request.{%27username%27:%27admin%27,%20%27password%27:%27admin%27}

Please advice me what is going wrong here?
I agree. Here's the link:
subject: Session Id problem in servlet
It's not a secret anymore!