-2

My source Yii have this problem , when i use xdebug. I don't know why.

enter image description here

2

3 Answers 3

0

It looks like you use Yii 1 with PHP 7.2 According to this post and number of other sources like this one and this one, you have a yii bug that can be reported here

The answer from the other topic:

I have done a bug report at php.net and they explained that this is not a bug. Yes in PHP 7.2 a warning is generated now. However this never worked as intended, it just failed silently.

For creating multiple sessions it is required to use session_id(). Have a look at this related question: PHP How can I create multiple sessions?

session_name() as well as session_set_cookie_params() are always nonesense if the session is already running.

For the original answer have a look here: https://bugs.php.net/bug.php?id=75650&thanks=2

Sign up to request clarification or add additional context in comments.

Comments

0

Simple fix:

function _read($id)  
   PHP 7.0 -> if is empty return false
   PHP 7.2 -> if is empty return ''

then add @ to other functions and remember to run session_name before session start

@session_name('SOMEID');
@session_start(...
...
@session_set_save_handler(...

Comments

0

It's work for me:

  1. Make new class SomeSession in protected/components folder:
class SomeSession extends CCacheHttpSession
{
    public function open()
    {
// don't start new session if session is started now
    if (session_status() === PHP_SESSION_NONE) 
    {
           parent::open();
    }
}
  1. in main.php in session section edit:
'session'      => [
            'class'       => SomeSession::class,
            'sessionName' => 'SomeSessionName',
            'autoStart'   => true,
            'cookieMode'  => 'allow',
        ]
  1. done =]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.