You can try this code:
public function set($key, $value) { if (is_array($value) && isset($_SESSION[$key]) && is_array($_SESSION[$key])) { $_SESSION[$key] = ArrayHelper::merge($_SESSION[$key], $value); } else { $_SESSION[$key] = $value; } } ... \Yii::$app->session->set('myvar',['subKey' => 'value']);
By:Xtreem Solution
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community