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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:59:38+00:00 2026-05-13T11:59:38+00:00

My web application’s home page has a RememberMe checkbox. If the user checks it,

  • 0

My web application’s home page has a RememberMe checkbox. If the user checks it, I willl store email-id and password in cookies. This is my code:

if (this.ChkRememberme != null && this.ChkRememberme.Checked == true)
   {
     HttpCookie cookie = new HttpCookie(TxtUserName.Text, TxtPassword.Text);
     cookie.Expires.AddYears(1);
     Response.Cookies.Add(cookie);
   }

What I want to know is:

  • Is it secure to store passwords in cookies?
  • What is proper way of doing the same?
  • What are the best practices in setting time for a cookie?
  • 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-13T11:59:38+00:00Added an answer on May 13, 2026 at 11:59 am

    It’s NOT secure to store passwords in cookies because they are available as plain text.

    A good place to find some answers about cookies is Cookie Central. For membership usually is used a cookie with a long string called ‘token’ that is issued from the website when you provide your user name and password. More about the process you can find in this article.
    When using forms authentication in ASP.NET you can set the authentication cookie like this:

    FormsAuthentication.SetAuthCookie(userName, isPersistanceCookie);
    

    The second parameter is used for "Remember Me" functionality – if true it will create persistent cookies that will last after you leave the site. You can also programatically manipulate the cookie like this:

    HttpCookie authCookie =
      HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My web application has a login page that submits authentication credentials via an AJAX
my web application has more than one user with unique usercode. As soon as
My web application sends email fairly often, and it sends 3 kinds of emails:
My web application (MonoRail, Windsor, ActiveRecord) has a Startable import service and one or
my web application supposed to send email reminders in some point it will send
The web application that I am developing right now has something called quiz engine
The web application has following prerequisites: Written in PHP Several menues, also a hierarchy
The web application my organization has written to perform customer care functions doesn't have
The web application im working on has a few custom attributes on HTML elements
The web application that I am developing right now has something called quiz engine

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.