php - Configure Phalcon Flash output to use specific session adapter

55

I'm using the Phalcon flash service to store temporary messages between HTTP redirects.

It worked great until I recently changed to a database session adapter. Now flash messages are being stored in the database but are not being deleted.

I don't want these messages to touch the database so I setup the previous session method in the DI but under a new tempSession entry.

public function initTempSession($options = [])
{
    $this->di->set(
        'tempsession',
        function () {
            $tempSession = new PhSession();
            $tempSession->start();
            return $tempSession;
        },
        true
    );
}

How can I configure the flash service to use this session function, rather than the 'default' database adapter?

People are also looking for solutions to the problem: codeigniter - why am i getting an error from file mysqli/mysqli_driver.php?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.