Skip to content

CodeIgniter Session Destroy Problem SOVLED for Logout

We know what we need. Actually we are confused at that time. Its very easy.
First time what we thinking their is a cookies or session problem. Not destroying fully or may be their global session created. But not like that …

Think Just think

Solution :

You have to submit the form using java script.  Our mistake is we are using anchor.

Follow our examples:
<script type=”text/javascript”>
        function submitform()
            document.myform.action=”<?php echo base_url();?>user/logout”;

Where is your login link put under form tag

<form action=”” name=”myform” id=”myform” method=”post”>
 a href=”javascript: submitform()”>Logout</a>