Welcome Guest, Not a member yet? Register   Sign In
Incomprehensible problem about sessions
#1
Sad 
(This post was last modified: 04-29-2020, 07:08 AM by nicolas33770.)

Good morning all,

I have been working for several weeks on a webapp project and I use sessions. I use Codigniter 3, and Jquery in order to display error messages. My notification system has been working for more than 4 or 5 weeks. I specify that I migrated to a new more powerful Proxmox server with SSD hard disks on which I migrated my LXC. I have been looking for more than 24 hours and I do not understand the problem.

I explain to you. I use a very simple session backup system for notification messages that I load when the pages are reloaded. I think I have found a solution to work around the problem but I would like to understand why it worked for several weeks and that now it no longer works ?


If I use one of the lines with the TAG (DOES NOT WORK ANYMORE), my "ajax_footer_load" data in sessions no longer appears while it was working before. I found a solution using "mark_as_temp" which is apparently working. But that worries me not to understand.

Do you have an idea ?


Code:
<script>
    $(document).ready(function() {
        <?php

        echo $this->session->ajax_footer_load;

        //$this->session->set_userdata('ajax_footer_load', ''); => DOES NOT WORK ANYMORE
        //$this->session->unset_userdata('ajax_footer_load'); => DOES NOT WORK ANYMORE
        //$this->session->mark_as_flash('ajax_footer_load'); => DOES NOT WORK ANYMORE
        //unset($_SESSION['ajax_footer_load']); => DOES NOT WORK ANYMORE

        $this->session->mark_as_temp('ajax_footer_load', 1); // => it seems to work

        ?>
    });
</script>
Reply
#2

If you install your app on a new server and it stop working, there’s a very good chance the problem is the new server and not the app. And what does it mean “Does not work anymore”? Is there any error message? What should it do and what does it actually do?
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#3

Thank you for your answer, given that my environments are in linux containers my software configuration has not been modified.

Is there any error message?
>> No error message, no log error.

What should it do:
>> echo data work

what does it actually do:
>> echo data don't show anything. is empty

The server I took is 10x faster than the previous one, even if it does not seem possible to me, is it possible that the variable is erased before being displayed? I also tried to go through a buffer variable, but I have the same result, ex:
tmpvar = $ this-> session-> ajax_footer_load;
echo tmpvar;

mark_as_temp works and displays my data, but it's still quite strange.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB