session data won't show

php session not working
session destroy
php check if session variable exists
php session not working between pages
php 7.2 session not working
php session login
django sessions
php session id

I don't know the problem. The data is saved in the session but it only shows the last input.

        $_SESSION['data'][] = $_POST;
        $_SESSION['data']['lengtezijde'] = $_POST['lengtezijde'];
        $_SESSION['data']['kleur'] = $_POST['kleur'];
        $_SESSION['data']['hoogte'] = $_POST['hoogte'];

        ?><th><?echo $_SESSION['data']['lengtezijde'];?></th><?
        ?><th><?echo $_SESSION['data']['kleur'];?></th><?
        ?><th><?echo $_SESSION['data']['hoogte'];?></th><?

I have tried your code also and it work me. Since it is an array, you must loop trough it to display the values and that is why I think it is giving you only the last value.

//Declare your variables
$lengtezijde = $_POST['lengtezijde'];
$kleur = $_POST['kleur'];
$hoogte = $_POST['hoogte'];

//Store it in session
$_SESSION['data'] = array(
    'lengtezijde' => $lengtezijde,
    'kleur' => $kleur,
    'hoogte' => $hoogte,

Now you can loop through your data and display it. I hope this helps.

How long do session variables last and how do I change this?, NET_SessionId. mode Specifies how session data is stored. which means that session data won't be lost when the Web Forms application is stopped or  By default the session data is not going to be written until the very end. So assuming the data isn't available may mean that the previous script hasn't completed executing before the reference is

if i understand what you looking for you must check your $_POST

i test this code

    $_SESSION['data'][] = "Test";
    $_SESSION['data']['lengtezijde'] = 'test1';
    $_SESSION['data']['kleur'] = 'test2';
    $_SESSION['data']['hoogte'] = 'test3';

    echo $_SESSION['data']['hoogte'];
    echo $_SESSION['data']['kleur'];
    echo  $_SESSION['data']['lengtezijde'];

result :


PHP - Sessions, The advantage of this approach is that you can host the session state server on a dedicated machine. This means that session data won't be lost when the Web  It does no one any good if this bit of important info about accessing and storing session data remains buried in manual comments. Session variables with a single number will not work, however "1a" will work, as will "a1" and even a just single letter, for example "a" will also work.

Make sure you have mentioned session_start() in First Line of your code , session_start() too, before you assign values to $_SESSION

Rest of things seems ok in your code. Never use below kind of assignment it will ruin your machine memory . If you run your script you will see that on each refresh of the page this size will be increasing. that is not advisable.

   $_SESSION['data'][] = $_POST;

What is the purpose of Session Data?, Session data is stored in a database table named django_session. • Session data is fetched upon demand. If you never access request.session, Django won't​  Apparently, your session_save_path(), for me it was /var/lib/php5/, needs to have correct permissions (the user running php, eg www-data needs write access to the directory). I accidentally changed it, breaking sessions completely.

If set to TRUE , this will result in the session being closed immediately after being read, thereby avoiding unnecessary locking if the session data won't be  You can encrypt 3270, 5250, and Open Systems session documents to protect them against unauthorized changes. Encryption effectively scrambles the data in a session document, helping to prevent unauthorized users from reading and changing the file's contents.

). shuts down their browser and not after a certain time (eg. A centralized session management data store provides consistent user experience, better session durability, and high availability. Get Started with Caching. There are various ways to manage user sessions including storing those sessions locally to the node responding to the HTTP request or designating a layer in your architecture which can

session_decode — Decodes session data from a session encoded string used to unserialize a PHP session data won't work if the session data contains string  Sessions are used to abstract the receiving and sending of cookies, data is saved on server side (like in database), and the client side cookie just has a session ID for identification. Sessions are also useful to avoid cases where the user browser is set to ‘not accept’ cookies.

  • check your post values
  • First line is not useful if you make it one by one just after
  • Also i will point out how insecure it is to send raw user data to your sessions which am guessing you will used to process an sql query later.
  • @JulesR if i dont have that line it wont store anything
  • @BobbyAxe yea i know but it is for myself to calculate things
  • Thanks you for your time you mean like: foreach ($_SESSION['data'] as $key => $value) { }