• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter 4 - Sessions and VIBER API

#1
Hello, everyone!

I am developing a Viber chat-bot and stucked with such kind of problem:

After every request from Viber server to my, Codeigniter creates new session, and all of the data, that I've stored during previous requests is destroyed.
I have the main method in my front-controller (Viber::index), which recieves the request from VIBER API. I've putted simple print_r to write session data after each request to file on the server.
Code:
public function index()
{
    $request = $this->request->getJSON();

    $file = APPPATH . 'debug.txt';
    $current = file_get_contents($file);
    $current .= print_r($this->session->get(),true);
    file_put_contents($file, $current);   
}
And, after several requests from Viber to my front-controller I have next picture in my debug.txt file:
Code:
Array
(
    [__ci_last_regenerate] => 1617702828
)

Array
(
    [__ci_last_regenerate] => 1617702828
)

Array
(
    [__ci_last_regenerate] => 1617702830
)
Is it possible somehow to save the state of the session, and use it throught all of the application?
I'll be very grateful for any help...
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.