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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:18:45+00:00 2026-05-22T01:18:45+00:00

I keep having complaints that users are logged in as each other. They can

  • 0

I keep having complaints that users are logged in as each other. They can even edit their profiles and post as them…this is obviously a huge issue. People who arent even registered are visiting the site and seeing they are logged in as other people.

This happens in Safari and Firefox

My sessions are set when people log in using the $_SESSION['variable'] = name; system, so pretty standard. The sessions are cross subdomain using:

ob_start();
session_set_cookie_params(0, '/', '.subverb.net');
session_start();

in the header of all my pages.

I have an iframe that holds the chat portion of the site which also contains the same header

I don’t know what other info I can give, so please ask. I really need this to get sorted but not sure what the problem is!

Thanks


In response to below:

The standard login script is lifted straight from a Larry Ullman textbook:

if ($un && $p) { // If everything's OK.

    // Query the database.
    $query = "SELECT member_id, member_firstname, member_type, username FROM member WHERE (username='$un' AND password=SHA('$p')) AND active IS NULL";  

    $result = mysqli_query ($dbc, $query) or trigger_error ("query: $query\n<br />MySQL Error: " . mysqli_error($query));

    if (@mysqli_num_rows($result) == 1) { // A match was made.

        // Register the values & redirect.
        $row = mysqli_fetch_array($result, MYSQLI_ASSOC);
        mysqli_free_result($result);

        $_SESSION['member_id'] = $row['member_id'];
        $_SESSION['first_name'] = $row['member_firstname'];
        $_SESSION['member_type'] = $row['member_type'];
        $_SESSION['username'] = $row['username'];

The facebook login script does the following:

$query = "SELECT * FROM member WHERE oauth_prov = 1 AND fb_userid = ".$user['id'];
    $result = mysqli_query ($dbc, $query) or trigger_error ("query: $query\n<br />MySQL Error: " . mysqli_error($dbc));


    if(mysqli_num_rows($result) == 1 ) {



    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {;


    $_SESSION['first_name'] = $row['member_firstname'];
    $_SESSION['member_id'] = $row['user_id'];
    $_SESSION['oauth_uid'] = $row['fb_userid'];
    $_SESSION['username'] = $row['username'];

All of the inputs are sanitized and there are not other ways for the user to add the details. Username and password added as normal, facebook id got from Facebook by clicking a link that executes the script.

These errors are happening well past login tho, or when login hasnt even happened. There is no other place where session values are set on the site.

  • 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-22T01:18:46+00:00Added an answer on May 22, 2026 at 1:18 am

    I would check the database routine that logs the users in for holes. Are you certain that it’s selecting the appropriate user and only the appropriate user? Have you tested whether your select statement is immune to different user input scenarios? Given that it persists across pageloads, it’s almost certainly a $_SESSION problem. Assuming you load info about the user at login, it follows that the problem comes with the initial population of the $_SESSION variable during login. As such, you should definitely check the login script to make sure it’s solid.

    You may want to post other parts of your login script, so we can check it out for holes/problems.

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

Sidebar

Related Questions

i keep on having to affect elements relevant to other elements but my methods
Below is a generalization of a block of code that I keep having to
I keep having an error when running my web application. The error does not
We keep having some customers getting a warning from AVG Antivirus about our application.
I keep having problems with programs in Python (I'm a complete newb) where it
I'm writing a C program but I keep having problems with my array of
I keep getting this error with HG (Mercurial), it seems like it's having a
I'm having trouble getting my validation to act correctly. I keep getting the error
I am having issues with my software. In my piano software if I keep
I've recently started having trouble logging into my site using Facebook. I keep seeing

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.