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 8921987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:42:24+00:00 2026-06-15T06:42:24+00:00

I need to implement Remember me functionallity on my JSF site, i´ve been researching

  • 0

I need to implement “Remember me” functionallity on my JSF site, i´ve been researching about this topic trying to find what the best practices are. Ive found many answers, but i still have a question based on the technology i use and the way i store user passwords in my database.

Summarizing what i’ve found

  • Create a database table containing the user and a hard to guess long serial.
  • When a user logs in with the remember me option checked, generate a registry on the db table and send a cookie to the user with both username and serial in it.
  • In case the same user isnt logged in, and has a valid cookie according to the database, Automatically login the user.

How i actually login users

Based on Java EE standards i use JAAS and i store the MD5 version of user passwords.
I login my users through the login method of the HttpServletRequest class which needs a username and a password in order to validate the authentication and set the user principal.


Based on these two facts, how can i do the automatic login based on this best practice if i need both username and password in order to login the user?

  • 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-06-15T06:42:26+00:00Added an answer on June 15, 2026 at 6:42 am

    how can i do the automatic login based on this best practice if i need both username and password in order to login the user?

    Just get username and password straight from the DB based on the value of the "remember me" cookie. Then you can provide them to the HttpServletRequest#login() method.

    Note that the value of the "remember me" cookie should absolutely not contain any hints about the username, password nor ID. It should be an absolutely random value. The java.util.UUID is helpful here.

    See also:

    • Automatic login to JSF application on revisits, after once logged in
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a Remember Me login functionality for an ASP.NET MVC site
Every time I need to implement a comparator, I get stuck trying to remember
I need to implement a Remember me button in a login form that uses
i need to implement a Remember password option in my program, it works with
I need to implement a Stay Signed in or Remember Me check box to
I am trying - with JSF 2.0 - to implement in a neat way
Possible Duplicate: How to implement re-ordering of CoreData records? I'm trying to find a
Short Working on login system and trying to implement remember me feature. Recently, l
I need to implement search feature in WPF TreeView (basically I need to remember
I need to implement a simple remember me option in a java servlet with

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.