Steps to reproduce the issue
If sessions exipired and if you are in media manager .If you try to upload ,delete,createfolder ,sharelink,download etc except editing of
images you get a unexpected error . This is not in case of edit because edit functionalty is plugin and their is check in media component before calling plugin so in that case user redirect to login page if session expires
Expected result
After session expire user must redirect to login page if he/she try to do any thing on adminstrator end just like in all component .
Actual result
following errors
System information (as much as possible)
Joomla 4.2.7
Additional comments
This error can be solve by adding the following code in libraries/src/Session/Storage/Storage.php
in the set() method
$app = JFactory::getApplication();
if (!$this->getId()) {
$app->redirect(JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode(JUri::getInstance()->toString()), false));
}