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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:26:48+00:00 2026-05-23T08:26:48+00:00

I would like some clarification on what are some best practices for secure web

  • 0

I would like some clarification on what are some best practices for secure web login and, further, persistent login for a PHP application that is authenticating against Active Directory.

  1. At login, does it make sense to implement a Post-Redirect-Get model? Storing the password in $_SESSION probably isn’t a good idea.

  2. After authentication, is checking if a specific $_SESSION field is set a valid and secure way to check if a user is logged in?

  • 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-23T08:26:49+00:00Added an answer on May 23, 2026 at 8:26 am

    It is NOT a good idea to store the password in plain text at any point in time.

    1) I do not recommend the PRG model for a login page. The worst thing that could happen is that the person is logged in twice. That’s not so bad.

    Data stored in $_SESSION can typically not be read by the client. They ARE stored on the server where a malicious employee or hacker might get access to them.

    2) After authentication it is ok to check the session to see if someone is logged in. Someone may spoof someone else’s session id but the chance of that is minimal as long as you are running SSL. I recommend storing the IP, user agent, and other information you can get easily in the $_SERVER variable and comparing it either on occasion or every time. To reduce the chance that someone has hacked the other person’s session id.

    Regenerating a session id on login doesn’t make a lot of sense to me, although I don’t know your particular scenario. My suggestion is to simply regenerate it on log out. Also, you can add a time out feature to the session if you like.

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

Sidebar

Related Questions

I just have a small question that I would like some clarification about, if
I am learning C++ exceptions and I would like some clarification of the scenario:
I got nabbed by the following bug again and would like some clarification to
OK n00b here with SOAP, Would like some clarification on how to use SOAP.
I would like some advice on the best approach to use in the following
I'm writing a small application in VB.NET and I would like some of the
I have Java servlet-based web applications. I would like to implement some operations in
I would like some clarification on what the code in front of the HTML
I would like some clarification on what happens when a class is instantiated on
I would like some of my preferences to have icons, like the Settings app.

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.