New answers tagged

0

Use an array: $session = \Drupal::request()->getSession(); $allowed_temp_files = $session->get('anonymous_allowed_file_ids', []); $allowed_temp_files[$file->id()] = $file->id(); $session->set('anonymous_allowed_file_ids', $allowed_temp_files); Example from /core/modules/file/file.module


Top 50 recent answers are included