Support the ongoing development of Laravel.io →
Laravel Session
Last updated 2 years ago.
0

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

Highly Skilled Laravel Developer

Dedicated PHP Developer

0

Sign in to participate in this thread!

Eventy

Your banner here too?

lucho lucheras Joined 22 Dec 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.