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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:29:17+00:00 2026-05-23T04:29:17+00:00

To login I use: <?php session_start(); if($_POST){ $csUSER=’USERNAME’; $csPASS=’PASSWORD’; $user=$_POST[‘user’]; $pass=$_POST[‘pass’]; if ($user==$csUSER) {

  • 0

To login I use:

<?php
session_start();

if($_POST){
$csUSER='USERNAME';
$csPASS='PASSWORD';
$user=$_POST['user'];
$pass=$_POST['pass'];
if ($user==$csUSER) {
    if ($pass==$csPASS){
        $_SESSION['cdb']="1";
        header("Location: /");
        exit;
    } else {
        $passerror='<span class="errormsg">Wrong Password.</span>';
    } // END IF PASSWORD
} else {
$usererror='<span class="errormsg">Wrong Username.</span>';
} // END IF USERNAME
} // END IF $_POST
?>

To allow myself to do admin tasks per page (included in all pages [top of page]):

<?php
session_start();

if(isset($_SESSION['cdb'])){  
$loggedn="WORD";
}
?>

This allows me to:

<?php
if ($loggedn=="WORD") { WHATEVER }
?>

And to make sure I only have access to backend pages when logged in (included in all backend pages):

<?php
// backend login check
if($loggedn!="WORD") {
header("Location: /"); // if not logged in, go to homepage
exit;
}
?>

The problem is, it works perfect on my pc, but I have another pc my wife uses for data collation and it does not stay logged in on her pc. We both use Linux (Fedora) with FF. I have been over ever line of code in each page, help!

  • 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-23T04:29:18+00:00Added an answer on May 23, 2026 at 4:29 am

    A few things to check:

    1. Ensure that you are starting with a clean slate. Clear cache and cookies in your browser to ensure that you don’t have an old session open.
    2. Ensure that session data is being stored on the new machine. Session data is commonly stored in /tmp
    3. Ensure that there is no client-specific code being executed in relation to the session.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a PHP login script that challenges user for username & password.
<?php session_start(); if(isset($_POST['username']) && ($_POST['password'])) { $con=mysql_connect(localhost,root,); if(!$con) { die('Could Not Connect:'.mysql_error()); } mysql_select_db(tcs,$con);
<?php session_start(); include(connect.php); $timeout = 60 * 30; $fingerprint = md5($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']); if(isset($_POST['userName']))
I am trying to use Twitter Oauth to login. index.php <?php require (twitteroauth/twitteroauth.php); session_start();
I use asp:Login control, user can login properly, but while checking user Profile information
I use PHP code below for login without using database. It redirects to home.php
I have written php script for user login but instead of displaying the result
Our user authentication system makes use of cookies and $_SESSION variables to determine logged-in
I'm trying to use a PHP login form tutorial I found somewhere online, and
I am trying to use PHP and cURL to log in to a website

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.