mapleleaf Posted October 29, 2008 Share Posted October 29, 2008 I am trying to end a session for logging out. If i set $_SESSION['user'] and by default sessions are creating cookies how do i delete the cookie? I don't know the cookie name. unset($_SESSION['user']) is not enough. Thanks Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/ Share on other sites More sharing options...
popcornplya Posted October 29, 2008 Share Posted October 29, 2008 session_destroy() Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/#findComment-677112 Share on other sites More sharing options...
mapleleaf Posted October 29, 2008 Author Share Posted October 29, 2008 i tried that but if there is a cookie it doesn't end it Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/#findComment-677122 Share on other sites More sharing options...
revraz Posted October 29, 2008 Share Posted October 29, 2008 Let's see the code you are using. Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/#findComment-677125 Share on other sites More sharing options...
mapleleaf Posted October 29, 2008 Author Share Posted October 29, 2008 <?php session_start(); unset($_SESSION['u']); session_destroy(); ?> having $_SESSION['u'] = 'name'; Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/#findComment-677129 Share on other sites More sharing options...
xtopolis Posted October 29, 2008 Share Posted October 29, 2008 The default name of the cookie is: PHPSESSID I think manually deleting it is something like: <?php setcookie ("PHPSESSID", "", time() - 3600); ?> Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/#findComment-677131 Share on other sites More sharing options...
mapleleaf Posted October 29, 2008 Author Share Posted October 29, 2008 xtopolis has it. Thanks Link to comment https://forums.phpfreaks.com/topic/130517-solved-totally-end-session/#findComment-677148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.