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
think…
think…

Solution :

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

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

Where is your login link put under form tag

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