Jump to content

Recommended Posts

Hmm.. Let me try..

[b]Edit[/b]:
OMG >.< Now then I know it's not working in loop, or you wanna use a long way ?
[code]$_SESSION['test1'] = "";
$_SESSION['test2'] = "";[/code]

Hmm not sure this thread will helps anot, [a href=\"http://www.codecomments.com/message242702.html\" target=\"_blank\"]http://www.codecomments.com/message242702.html[/a]
Your code will not work as PHP is unsetting a session var called 'test$i' it is treating your variable as-is meaning it is not swaping $i with its value.

So change your unset code to this:
[code]unset($_SESSION['test' . $i]);[/code]
Now PHP will parse the variable $i rather than treating it as text.

Also if you want to destroy a session you should use session_destroy();
[!--quoteo(post=387119:date=Jun 23 2006, 06:26 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 23 2006, 06:26 AM) [snapback]387119[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Also if you want to destroy a session you should use session_destroy();
[/quote]
Thanks..that works.
Doesn't session_destroy kill all session data ..I just want to unset a particular variable.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.