![]() |
CI4 running in apache server virtualhost. Failed to decode session object. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: CI4 running in apache server virtualhost. Failed to decode session object. (/showthread.php?tid=74663) |
CI4 running in apache server virtualhost. Failed to decode session object. - gentlemanoi - 10-21-2019 Requesting multiple connection to the server using session() will return an error. session_start(): Failed to decode session object. Session has been destroyed I am using a virtualhost in my wampp server to connect to the public folder of CI4. Every time I have concurrent request to the server I will get this error and will redirect to the login page because the session was destroyed. I also added the line below to my virtualhost to save the sessions on a specific project. php_value session.save_path "${INSTALL_DIR}/www/CI4/writable/session" I got this error on php logs: Quote:PHP Fatal error: Uncaught ErrorException: Unknown: Cannot call session save handler in a recursive manner in Unknown:0 Do you have any idea about this? or can you recommend other way to point the specific project to the public folder? I can't change my DocumentRoot because there are multiple projects on my server. RE: CI4 running in apache server virtualhost. Failed to decode session object. - InsiteFX - 10-23-2019 Must be a configuration problem because I am running file sessions on XAMPP with vhosts with no problems. RE: CI4 running in apache server virtualhost. Failed to decode session object. - gentlemanoi - 10-23-2019 (10-23-2019, 06:08 PM)InsiteFX Wrote: Must be a configuration problem because I am running file sessions on XAMPP with vhosts May I know your configuration on vhosts? RE: CI4 running in apache server virtualhost. Failed to decode session object. - InsiteFX - 10-24-2019 I can show you one but you would need to edit it for yourself. Code: #-------------------------------------------------------------- That's how I do it for both http:// and https:// I program using the https:// For the sessions I load it in my BaseController and extend all controllers form that. PHP Code: <?php Hope that helps, you can use the session helper method or use regular session globals. RE: CI4 running in apache server virtualhost. Failed to decode session object. - gentlemanoi - 10-29-2019 (10-24-2019, 12:47 PM)InsiteFX Wrote: I can show you one but you would need to edit it for yourself. This will still gives me the same error if i do multiple requests using ajax. RE: CI4 running in apache server virtualhost. Failed to decode session object. - John_Betong - 10-29-2019 @gentlemanoi Quote:This will still gives me the same error if i do multiple requests using ajax. I use Ajax and think that a separate PHP instance is started and does not recognise the parent constants and they have to be declared again ![]() RE: CI4 running in apache server virtualhost. Failed to decode session object. - gentlemanoi - 10-29-2019 (10-29-2019, 10:39 PM)John_Betong Wrote: @gentlemanoi Yes. That's why I always got this error. |