DeanWhitehouse Posted May 12, 2008 Share Posted May 12, 2008 how can i destroy a specific session e.g. $_session['cake'] session_destroy($_session['cake']); will that work? Quote Link to comment https://forums.phpfreaks.com/topic/105322-solved-destory-certain-session/ Share on other sites More sharing options...
DarkWater Posted May 12, 2008 Share Posted May 12, 2008 unset($_SESSION['cake']); Quote Link to comment https://forums.phpfreaks.com/topic/105322-solved-destory-certain-session/#findComment-539356 Share on other sites More sharing options...
DeanWhitehouse Posted May 12, 2008 Author Share Posted May 12, 2008 ok, thanks i am now stuck with this <?php if($_SESSION['lang_ru'] == true) { ?> <a href="?lang=en">English</a> <?php } if($_SESSION['lang_en'] == true) { ?> <a href="?lang=ru">Russian</a> <?php } else { ?> <a href="?lang=ru">Russian</a> <?php } ?> When you select a lanuage you still see the else option Quote Link to comment https://forums.phpfreaks.com/topic/105322-solved-destory-certain-session/#findComment-539365 Share on other sites More sharing options...
DarkWater Posted May 12, 2008 Share Posted May 12, 2008 $langs = array("ru|Russian", "en|English"); foreach($langs as $v) { $lang = explode("|", $v); if ($_SESSION["lang_$v"] != true) { echo '<a href="?lang=' . $lang[0] . '">' . $lang[1] . '</a>'; } } Quote Link to comment https://forums.phpfreaks.com/topic/105322-solved-destory-certain-session/#findComment-539378 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.