2 Link goes to 404
source | link

Add following config into global di.xml [SR/StackExchange/etc/di.xml]

<virtualType name="SR\StackExchange\Model\Session\Storage" type="Magento\Framework\Session\Storage">
    <arguments>
        <argument name="namespace" xsi:type="string">stackexchange</argument>
    </arguments>
</virtualType>
<type name="SR\StackExchange\Model\Session">
    <arguments>
        <argument name="storage" xsi:type="object">SR\StackExchange\Model\Session\Storage</argument>
    </arguments>
</type>

SR/StackExchange/Model/Session.php

namespace SR\StackExchange\Model;

class Session extends \Magento\Framework\Session\SessionManager
{

}

Here is an example

Add following config into global di.xml [SR/StackExchange/etc/di.xml]

<virtualType name="SR\StackExchange\Model\Session\Storage" type="Magento\Framework\Session\Storage">
    <arguments>
        <argument name="namespace" xsi:type="string">stackexchange</argument>
    </arguments>
</virtualType>
<type name="SR\StackExchange\Model\Session">
    <arguments>
        <argument name="storage" xsi:type="object">SR\StackExchange\Model\Session\Storage</argument>
    </arguments>
</type>

SR/StackExchange/Model/Session.php

namespace SR\StackExchange\Model;

class Session extends \Magento\Framework\Session\SessionManager
{

}

Here is an example

Add following config into global di.xml [SR/StackExchange/etc/di.xml]

<virtualType name="SR\StackExchange\Model\Session\Storage" type="Magento\Framework\Session\Storage">
    <arguments>
        <argument name="namespace" xsi:type="string">stackexchange</argument>
    </arguments>
</virtualType>
<type name="SR\StackExchange\Model\Session">
    <arguments>
        <argument name="storage" xsi:type="object">SR\StackExchange\Model\Session\Storage</argument>
    </arguments>
</type>

SR/StackExchange/Model/Session.php

namespace SR\StackExchange\Model;

class Session extends \Magento\Framework\Session\SessionManager
{

}
1
source | link

Add following config into global di.xml [SR/StackExchange/etc/di.xml]

<virtualType name="SR\StackExchange\Model\Session\Storage" type="Magento\Framework\Session\Storage">
    <arguments>
        <argument name="namespace" xsi:type="string">stackexchange</argument>
    </arguments>
</virtualType>
<type name="SR\StackExchange\Model\Session">
    <arguments>
        <argument name="storage" xsi:type="object">SR\StackExchange\Model\Session\Storage</argument>
    </arguments>
</type>

SR/StackExchange/Model/Session.php

namespace SR\StackExchange\Model;

class Session extends \Magento\Framework\Session\SessionManager
{

}

Here is an example