This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Id problem in servlet" Watch "Session Id problem in servlet" New topic
Author

Session Id problem in servlet

harshad kadam
Greenhorn

Joined: Mar 19, 2011
Posts: 8
Hello,
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
http://192.168.5.9:8080/MyProj/MyServlet?_service=login&_param={%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.
http://local.myproj.com/MyServlet?_service=login&_param={%27username%27:%27admin%27,%20%27password%27:%27admin%27}


Please advice me what is going wrong here?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Id problem in servlet
 
Similar Threads
simple doubt in session management
Authontication module not properly working
I hope someone replies to this one
password hashingsalting in struts
Session Management