How to Destroy all sessions and cookies in codeIgnitor?

I am wondering if is there any way to remove all domain site cookies and sessions params.
Ankur Rajput
Asked 02-11-2019
36

Answer (1)
Distroy cookies in php
if (isset($_COOKIE['remember_user'])) {
    unset($_COOKIE['Hello']);
    unset($_COOKIE['HelloTest1']);
    setcookie('Hello', null, -1, '/');
    setcookie('HelloTest1', null, -1, '/');
    return true;
} else {
    return false;
}</pre>
                                    </div>

                                </div>
                            </div>
                            <div class="col-md-2 com-by">
                                <div><img src="https://myinboxhub.co.in/data/avtar.png" style=""></div>
                                <div>Harsh Aggrawal</div>
                                <div>Asked  22-05-2019</div>
                                <div>45 Likes</div>
                            </div>
                            <div class="col-md-10">
                                <div class="ans-count"> <i class="	glyphicon glyphicon-comment"></i>	Comments</div>
                            </div>
                                                        <!-- submit comment--->
                            <div class="col-md-10" style="">
                                <div class="submit-comment" onclick="showEditor(68)">Write comment</div>				
                                <div style="display:none" id="div68">
                                    <div class="" id="comAlert68" style="display:none"></div>
                                    <textarea type="text" name="comment68"  id="comment68" class="form-control textarea" placeholder="Write your comment..."></textarea>
                                    <span class="btn btn-submit" onclick="submitComment($('#comment68').val(),68)">Submit</span>
                                </div>
                                <br/>
                            </div>
                        </div>
                                                <div class="col-md-12 offer-content ans-content">
                            <div class="col-md-10">
                                <div class="offer-title">
                                    <div class="ans-count">	<i class="	glyphicon glyphicon-list-alt"></i> Answer (2)</div>
                                    <div class="ans-div"> 
                                        <pre>
$this->session->sess_destroy();</pre>

<xmp>use this code in your method.
                                    
Ankur Rajput
Asked 28-06-2018
45 Likes
Comments
how to get #variable or any variable from url in javascript
By : Deepak Sharma | 05-11-2019 | 45 Likes
if url is www.example.com#home1 var hash = window.location.hash.substr(1); alert(hash);
By : Ankur Rajput | 05-11-2019 | 45 Likes
Write comment

Submit your answer