CodeIgniter Forums
session_destroy() problem. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: session_destroy() problem. (/showthread.php?tid=42209)



session_destroy() problem. - El Forum - 05-30-2011

[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();
-----------------------------------------------------------------


session_destroy() problem. - El Forum - 05-30-2011

[eluser]John_Betong_002[/eluser]
Look in your duplicate thread.

http://ellislab.com/forums/viewthread/190374/#898932
 
 


session_destroy() problem. - El Forum - 05-31-2011

[eluser]sivakarthick[/eluser]
Still I am facing problem. Now this is the error occuring.

Severity: Notice

Message: A session had already been started - ignoring session_start()

Filename: libraries/Session.php

Line Number: 97

Thanks.


session_destroy() problem. - El Forum - 05-31-2011

[eluser]John_Betong_002[/eluser]
session_start() and session_destroy() are PHP functions.

I done a quick Google on "Trying to destroy uninitialized session " and found umpteen occurrences and possible solutions.

Let me know your solution - I am off for a beer Smile