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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:16:03+00:00 2026-06-02T23:16:03+00:00

I’m making a new login system to practice my PHP, since the last one

  • 0

I’m making a new login system to practice my PHP, since the last one I made was pretty insecure as I’ve found out with the more I’ve learnt…

Anyway, essentially I’m getting a little confused about how to truly make it secure. A lot of answers to similar things regarding this state that authenticating a user per-page isn’t necessary; that they just need to be authorized. However, say for instance I wanted to make it possible for users to force all users currently logged into an account to be logged out when the password for the account is changed (in practice the person who changed the password would be kept logged in, that’s a simple enough task…).

The only way I can think of this working is if the password is stored somehow, so that it can be compared with a users credentials in the database.

Essentially, I have a few questions because of this:

  1. Why do most people think it isn’t worth making a login system work this way?
  2. Is there some ridiculously easy way of doing this that I’m overlooking? (Either way, if anyone can direct me to a way of doing it I’ll greatly appreciate it!)
  3. When making a login system remember you, what should be in a cookie for it to be secure and for it to still remember you?

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-06-02T23:16:06+00:00Added an answer on June 2, 2026 at 11:16 pm

    Good security relies on multiple levels of authentication… storing authentication data in sessions and cookies and encrypting passwords etc.

    to answer your question as to how this could work.

    You could build a basic authentication class that after authenticated users, stores a cookie and sets the session variable(s) including a password hash. Whatever method you use to verify a user is authenticated on each page can check the database for the password compared to the hash. and if it has changed the authentication would fail.

    You can ensure that a cookie be set over a https connection. if its not https it won’t set a cookie however. There is also a parameter in the setcookie function that enables you to limit the cookie to http only so javascript can’t get a hold of the cookie like cross site scripts ect. http://php.net/manual/en/function.setcookie.php

    Security is all about understanding how something works and how it CAN be exploited.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.