Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Session Id problem in servlet

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic