Take the 2-minute tour ×

If i uncomment this code, i get blank page at site. If i comment this, site works. Here is my exit code (auth by sessions):

    function exit($action='') {
    if ($action == "true") {
        echo "Exit.";
    $login = $this->session->userdata('username');
    if ($login == NULL) {
        redirect('/blog/login/', 'location', '301');
    $array_itmes = array('username' => "$login");
    redirect('/blog/exit/true/', 'location', '301');}

after normal login:

    $newdata = array('username' => "$name");

in other actions i using:

    if ($login !== NULL) {
        echo $login;

and I get my username. where is an error in first code? i`m from Russia, so sorry for bad English.

share|improve this question
Not sure if I'm following you 100% which is why I can't answer your question, but defining a method called 'exit' might be problematic, since it's a reserved word for PHP. Try renaming it and see if that changes anything. –  polarblau Mar 19 '11 at 21:23
add comment

2 Answers

up vote 0 down vote accepted

Nice! Just replace it with $this->session->sess_destroy(); But thanks :)

share|improve this answer
If this solves your problem please accept your own answer to close this question. Cheers! –  polarblau Mar 19 '11 at 21:37
add comment
$array_val = array('userid' => '','username' => '', 'email' => '');


This is remove individual session details.

share|improve this answer
add comment

Your Answer


