Level 122
Please format your code by putting 3 backticks ``` on a line before and after each code block
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i m checking that session is exist or not like
if (Session::has('guest_user_chat_ids'))
{
echo 'if -----'.Session::get('guest_user_chat_ids');
}
else
{
Session::put('guest_user_chat_ids', 'yusuf');
echo 'else ==== '.Session::get('guest_user_chat_ids');
}
exit;
but always output of else part like "else ==== yusuf";
if you use exit then anything you write to session will be lost because the terminable middleware does not run and it is there where the session data is persisted.
Just use a return instead
Please or to participate in this conversation.