Welcome Guest, Not a member yet? Register   Sign In
Page not loading if session is enabled!!

(This post was last modified: 05-17-2020, 03:43 PM by webdevron.)

I have developed web application using Beta version of CI4. Now I am updating this to current version. But surprisingly the session is not working.

Here is the sample code.
PHP Code:
<?php if(session('cart')):?>
        <span class="badge badge-cnapp rounded-sm small-70 float-left">
                <?php echo count($session->cart)?>
<?php endif;?>

If I load the website with the above code, the browser is showing:

Quote:Hmmm… can't reach this page
The connection was reset.

But if I comment out the above code like bellow, everything is working fine:

PHP Code:
<?php // if(session('cart')):?>
        <span class="badge badge-cnapp rounded-sm small-70 float-left">
                <?php //echo count($session->cart)?>
<?php //endif;?>

[Image: Output.png]
"Who thinks in code"
Perfectly describes who I am

Messages In This Thread
Page not loading if session is enabled!! - by webdevron - 05-17-2020, 03:41 PM

Theme © iAndrew 2016 - Forum software by © MyBB