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

  • Home
  • SEARCH
  • 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 6534827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:17:54+00:00 2026-05-25T10:17:54+00:00

I use to cookie for Remember Me functionality. This is how i set the

  • 0

I use to cookie for Remember Me functionality.

This is how i set the cookie:

$value = $dbusername.'|'.$dbpassword;
setcookie('abc', $value,time()+60*60*24*180, '/');

Retrieve cookie:

$cookie = $_COOKIE['abc'];
$values = explode("|", $cookie);
$username_ck = $values[0]; //ck stands for cookie
$password_ck = $values[1];

What is a good way to secure my cookies (username/password)?
The password in my database is stored in plain text. I don’t want to to encrypt the password in db.

  • 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-25T10:17:54+00:00Added an answer on May 25, 2026 at 10:17 am

    First you should NEVER EVER store passwords in plain text db!

    Second: you should NEVER EVER store passwords in plain text in cookies!

    Third: if you use cookies to implement something like a remember me option you don’t need to store the password in the cookie, but rather a random token stored in both the db and the cookie which automatically gets invalidated every time the user logs on and also create a new one every time the user logs in.

    Also did I already mention to NEVER EVER STORE PASSWORDS IN PLAIN TEXT?

    EDIT

    Please also checkout: http://jaspan.com/improved_persistent_login_cookie_best_practice

    Which describes the best way of using cookies (basically a step-by-step explanation of what I already tried telling you). I say the best way since I haven’t found a better way yet 🙂

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

Sidebar

Related Questions

I am trying to use the Jquery cookie plugin to remember the last selected
I want to use cookie in my project. But now i m using session.
On my web site (asp.net mvc), I use cookie to store search pattern. when
We're creating a new consumer/public-facing ASP.Net web app. There are two concerns: --Use cookie
Due to a bug in Flash, I have to use the ASPXAuth cookie to
This is an interview question asked a month ago.... Do session use cookies? If
What is the best way to implement ' remember me ' functionality on an
I'm trying to implement a Remember Me login functionality for an ASP.NET MVC site
We use keep me logged in or Remember me option to be logged in
Due to server settings I am having to use $_COOKIE instead of $_SESSION to

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.