Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6897249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:08:42+00:00 2026-05-27T07:08:42+00:00

I have developed simple website using Tomcat and Java. Now I’m trying to add

  • 0

I have developed simple website using Tomcat and Java. Now I’m trying to add authentication to it. I am storing username and encrypted password in database.

How do I validate user on every request to website?
While doing my research I found out that I need to set some cookie, return it to browser if user is authenticated, and then validate it request by checking this cookie in every request I get from user.

Also, how do I manage the session, i.e. create new session for user upon authentication, set timeout, clear session and cookie upon logout?

Web development and particularly authentication/user management is very new to me, so I will appreciate your help.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:08:43+00:00Added an answer on May 27, 2026 at 7:08 am

    This will depend a lot upon the language you are using to develop the website and how you plan to handle sessions.

    PHP Sessions
    Java (JSP) Sessions
    ASP.NET Sessions
    ASP Sessions
    …etc

    the list goes on, especially with how to manage authenticating.

    The general (pseudo code) for this usually revolves around something of this nature

    Depending on the language of course:

    1. User Creates Account (typically an HTML form posting to your server side code)
    2. Account Information Is Stored to the database
    3. Cookie is created with information allowing user to auth in the
      future (with cookie duration)
    4. Session is created for the duration of the users login
      • User leaves the website
      • User comes back to the website
    5. Website checks for stored cookie
    6. if Cookie is found – check cookie, is the auth still good? (did the
      users password change recently? has the cookie expired)
    7. If the cookie is good – create a new session and allow the user into the website
    8. If the cookie is bad – present the user with a login form

    Rinse/repeat as the user logs in and out.

    Depending on your language you will want to look at different resources, however cookie generation is a pretty simple task and can be easily done with JavaScript and HTML. Take a look at http://www.w3schools.com/js/js_cookies.asp and see if it meets your needs. Note that from what I recall JavaScript only does Cookies, and not sessions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a simple mechanism for my mvc website to pull in html
I have developed a simple Silverlight control. I created this by using the Silverlight
I have developed a simple library in Ruby and need to use this in
I have developed a simple location aware iPhone application which is functionally working very
I have a simple windows Service developed in VS.net 2008 and VB.net. When I
I have a very simple windows Service that is developed in vb.net 2008. When
I recently began using BIRT and have developed a report to use with my
I have website developed in classic ASP . The URL is not SEO friendly
We have developed a large number of websites using ASP (jscript flavour), talking to
My i have to develop simple window based iphone application. In my first screen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.