Welcome Guest, Not a member yet? Register   Sign In
session_destroy() problem.
#1

[eluser]sivakarthick[/eluser]
Any body can help me to sort out this problem?

I am using dx_auth login library and when I try to logout it shows following error.

Severity: Warning

Message: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session

Filename: libraries/Session.php

Line Number: 111

This is my code.
————————————————————————————————
$_SESSION = array();


if (ini_get(“session.use_cookies”)) {
$params = session_get_cookie_params();
setcookie(session_name(), ‘’, time() - 42000,
$params[“path”], $params[“domain”],
$params[“secure”], $params[“httponly”]
);
}

session_destroy();
--------------------------------
#2

[eluser]John_Betong_002[/eluser]
Try:

Code:
session_start();

$_SESSION = array();
    
    
    if (ini_get(“session.use_cookies”)) {
      $params = session_get_cookie_params();
      setcookie(session_name(), ‘’, time() - 42000,
      $params[“path”], $params[“domain”],
      $params[“secure”], $params[“httponly”]
      );
    }

    session_destroy();
 
 
#3

[eluser]sivakarthick[/eluser]
Thank you for your reply. I'll give you a feed back once I checked.

Thanks.
#4

[eluser]sivakarthick[/eluser]
Still I am facing same problem. Don't they have any other options?
#5

[eluser]WanWizard[/eluser]
Does dx_auth use an alternative session library, or did you install one yourself?
#6

[eluser]John_Betong_002[/eluser]
 
Try this:
Code:
// suppress warning message
   $tmp = error_reporting(0);
   session_destroy();
   error_reporting($tmp);
   log_message('ERROR', __METHOD__. ': Only a warning - hope to find a fix soon :)');
   unset($tmp);
 
 
edit:

This post maybe relevant:
https://bitbucket.org/ellislab/codeignit...ng-session
 
 
#7

[eluser]sivakarthick[/eluser]
Thx for your all replies.

Yes, I have installed a session library as my self.

I'll change my script as per John_Betong_002 idea and let you know the result.

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB