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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:56:43+00:00 2026-06-05T09:56:43+00:00

I’m developing a site for someone where users can post problems to a website

  • 0

I’m developing a site for someone where users can post problems to a website and the Admin of the company can view the problems and give a solution for it. I use one page that takes care of the login handling and a mysql db. The problem is that i can log in, it shows me another panel(userpanel), but whatever other button i click, it takes me back to the login panel.
It used to work as i was able to post data to my database. but suddenly after some changes on my website, it stopped working (and i can’t find the problem anymore.)

When i log in, $_SESSION[“LoggedIn”] gets a value and goes to the other panel on the same page with http post. when i click a button there, it seems that $_SESSION[“LoggedIn”] is removed again because i check with isset if the user is logged in, otherwise it shows the userpanel.

//check user logged in
if (isset($_SESSION['LoggedIn'])) {

//Problem posted
if (isset($_POST["plaatsen"])) {
    //Processing - plaatsen
    postProblem();
    }
} else {
//do login thing

}

I’ve attached my code here and i hope anyone can help me out.

Index.php: http://pastebin.com/BZSirUTT

Functions.php: http://pastebin.com/7Hknhm9r

Website: http://php.olvgroeninge.be/~sac.26A-07/php/Oefeningen/Oefening3/index.php (it’s in dutch)

  • 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-05T09:56:45+00:00Added an answer on June 5, 2026 at 9:56 am

    Sessions typically don’t disappear by themselves. If they do, assuming you did run session_start() first, it can be due to:

    1. The session could not be saved on the server; this can be due to disc space or permission issues. It could also be due to any page output before the session_start() statement. Fortunately, you can see this by heightening the error reporting at the start of your script:

      ini_set('display_errors', 'On');
      error_reporting(-1);

    2. The session could not be found; for session to perpetuate it requires the session id at every request. Depending on your settings, this can come from the URL (PHPSESSID=xxx) or cookies. In the latter case, you can verify that your browser sends the cookie by whipping up the browser developer tools.

    3. You destroyed the session yourself; calling session_unset or session_destroy will clear and remove the session respectively. Make sure this doesn’t happen accidentally.

    4. The session is garbage collected; this normally only happens after some time of inactivity, configured using the relevant ini settings

    5. The session could not be read; just like #1 but for reading.

    Hope at least one of these points helps you.


    Debugging the session

    You can add the following code to all pages to isolate the problem:

    echo '<pre>', htmlspecialchars(print_r($_COOKIE, true)), '</pre>';
    session_start();
    echo '<pre>Session = ', session_id(), '</pre>';
    

    Update
    The problem is that the index.php doesn’t set any cookies; OP created a separate small test page which does set cookies. Turns out the problem is #2 then 🙂

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;

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.