Forums: Authenticating Using Sessions - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Authenticating Using Sessions

#1 User is offline   chamal 

  • Private
  • Icon
  • Group: Members
  • Posts: 1
  • Joined: 21-June 05

Posted 21 June 2005 - 06:42 PM

Hi,

I am writing a program using Java servlets. I want to use a session for user authentication.

In the login page I check users user name and password with usernames and password in my database and store username and password in a session.

After that do I have to check the user name and password stored in session with my database, in every page. Or can I just check wether there is a session avaiable and if the session is available, allow the user to view the page.


Thanks a lot,
Chamal.
0

#2 User is offline   Killaloop 

  • Master Sergeant
  • Icon
  • Group: Members
  • Posts: 677
  • Joined: 01-January 04

Posted 21 June 2005 - 11:50 PM

you can set a session variable after the user logged in and check for the variable on the other pages, if the value is false return him to the login page if not continue.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

  • Share



Our Sponsors:


SwiftLayer Affiliate Web Hosting