Getting session variable in view contextual filter drupal 8 I am new to Drupal 8. I get group_id in session variable just like that $_SESSION['groupbysession']['group_id'] = $path[2];. now i want to get that session variable in view Contextual filters.I have no idea how to do this. I also use view extra module for this but doesn't work for me.Thanks in advance
You'll need to create a custom module and pass the value Group ID value using hook_views_pre_view

Example:

/*
 * Implements hook_views_pre_view()
 */
function mymodule_views_pre_view(ViewExecutable $view, $display_id, array &amp;$args) {
  // Modify contextual filters for my_special_view.
  if ($view-&gt;id() == 'my_special_view') { // target a specific view
    // if you want you could make it even more specific by adding ex: "&amp;&amp; $display_id == 'block_1')"
    $group_id = $_SESSION['groupbysession']['group_id'];
    $args[0] = $group_id; // set argument
  }
}