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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:50:17+00:00 2026-06-13T02:50:17+00:00

For some reason I don’t manage to take some date from one page to

  • 0

For some reason I don’t manage to take some date from one page to another using the $_SESSION-variable.

On my index.php-page is a form where users can login.
I start with (where session_start() is in the inc_admin.php-file):

require_once '../includes/php/inc_admin.php';

if ($_GET['page'] == 'login') {
    $action = loginUser($_DB, $_POST['firstname'], $_POST['password']);
}

if(isset($_SESSION["user"])) {
    $action .= header('Location: ../admin/index.php');
}

echo $action;

The loginUser-function does set (among other) the $_SESSION:

$user = Leaders::getLogin($_DB, $firstname, $password);
if(!empty($user)) {
    $_SESSION["user"] = $user;
}

And as t should, when the user submits the form with correct data, he will be redirected to the ../admin/index.php-page. However, if I take a var_dump($_SESSION), the page tells me this variable is NULL.

What more do I need to do to make sure data is transferred over pages using $_SESSION?

  • 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-13T02:50:18+00:00Added an answer on June 13, 2026 at 2:50 am

    Make sure you call session_start() somewhere everytime you reload a page, or else the server won’t get the session details.

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

Sidebar

Related Questions

For some reason that I don't understand, video websites do not play when using
For some reason that I don't understand, when I create my SurfaceView from an
For some reason i don't like any of the themes that are on the
For some reason, dialogue boxes don't close in my program, even though shown by
I don't know why but for some reason I am not able to refer
Summary For some reason, git commands don't work the same when I am logged
I don't know what could be causing this issue, but for some reason, elements
For some reason, this line of code is returning undefined for $(this).attr(href) $(a).attr(href, javascript:page('
For some reason I can't detect I can't set a z index for any
For some reason, after submitting a string like this Jack’s Spindle from a text

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.