To keep the columns filters/sort values of a GridView through the session
Just add these four lines at the beginning of the actionIndex
public function actionIndex()
{
// Just add these four lines at the beginning of the actionIndex
if (count(Yii::$app->request->queryParams)==0)
Yii::$app->request->queryParams = Yii::$app->session->get('MyModelIndexParams');
else
Yii::$app->session->set('MyModelIndexParams', Yii::$app->request->queryParams);
$searchModel = new MyModelSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
...