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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:49:56+00:00 2026-05-14T23:49:56+00:00

I currently have a website that allows my visitors to login via a simple

  • 0

I currently have a website that allows my visitors to login via a simple script i’ve pasted together and wrote. Currently I only use sessions to keep visitors logged in. Are there any advantages to adding cookies to my website to store user logged in status?

Or is there a better way altogether?

using PHP

  • 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-14T23:49:57+00:00Added an answer on May 14, 2026 at 11:49 pm

    @Ramiro Gonzalez Maciel he said he has made that script, he doesn’t need frameworks to take as examples. Frameworks usually have scripts wrapped up and well placed.

    To respond that question:

    I usually store in cookie some md5 strings that are combined from his md5(password) and his username so I’ll know next tim he enters my website that is was logged in so I wouldn’t make him login again

    my example:

    <?php
        $username = $_POST['username'];
        $password = $_POST['password'];
        // sql and escape stuff witch will return 1 if he has entered a valid login
        if($sqlreturn == 1){
           // do login
           $wraplogin = md5($username."-".md5($password)."-".SECRET_KEY); // I always define a define('SECRET_KEY', 'mysecretkey'); in global file.
           // now you can store that $wraplogin in cookies and remember his login. Next time he enters the website, you read that cookie, compare it with what you have in your database and let him in.
        }
    ?>

    Now I know that is not the best example, but I’ve personally used it in very large websites (>500.000 users) and none has hacked in yet 🙂

    That’s the advantage in cookies for the login part.

    Best of luck.

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

Sidebar

Related Questions

I have a (currently very simple) website that is utilising Facebook's Website with Facebook
I have installed a script on my website that allows for a low contrast
I currently have a website (ASP.NET 3.5, IIS 7.0) that allows users to upload
I currently have a website that I am trying to optimize in terms of
We currently have a tool on our website that is created by JavaScript. The
I have a website that I'm making that needs a background resizer. Currently, I
I currently have a news website setup in PHP/MYSQL that's a bit old and
I am currently working on a website that will have a high volume of
I currently have a script that scrapes proxies off websites, but I'm just wondering
I have a website that allows users to input URLs to websites to share

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.