Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

best way to keep tracking of the user info?

 
Greenhorn
Posts: 12
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys,

i'm a newbie in jsp development and web development in general. I need to keep track of the user logged in my web application information (login, password, IP)
what is the best way to do such thing?
 
author & internet detective
Posts: 40847
829
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can store the login in the HttpSession (setAttribute). It is best to not keep track of the password. Read it once, authenticate and then keep a record in the session that the user is logged in. One way is to store the login only when authenticated. Keeping passwords in memory invites someone to do a memory dump and get them. The IP address is already available via the HttpRequest so you don't need to store it during the current session.
 
Aymen Benhmida
Greenhorn
Posts: 12
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the respons,

i have also other jsp files where i have to verify that the user is still logged before doing any action. for example, the user has created some article when logged in and then he passes to the welcome page so i have to verify that he is still logged in in order to let him some other actions. And there some other pages which must respond to the same senario. So do i have to verify that he is still logged in every page or there's a more clean way to do this.
and if this is the best way how can you advice me to do it the best possibly way.
 
Ranch Hand
Posts: 251
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can also use the html hidden field but this is not the good idea. HttpSession is best way to do that.
 
Sheriff
Posts: 67601
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet filter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic