session_destroy() gives warning after session_regenerate_id()

I am building this highscore system for a flash game. I am trying to protect this as much as possible. One of the protections is resetting a session id, using session_regenerate_id(). But this gives me an error when trying to destroy this session. I have attached the code i am using, and this gives me an error:

Warning: session_destroy(): Session object destruction failed in /path.to/script.php on line 65

View php info at: http://www.skybox.org/phpinfo.php

What is this error, and how can i make this work?
<?
 
// Start Session - For Cookies
session_start();
// Regenerate session id, keep data
session_regenerate_id();
 
// do stuff
 
// kill session
session_destroy();
// end php
die();
 
?>

Open in new window

LVL 8
wal_toorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

biztigerCommented:
Please post the output of the code snippet below
<?
 
// Start Session - For Cookies
session_start();
// Regenerate session id, keep data
session_regenerate_id();
 
// do stuff
 print_r($_SESSION);
// kill session
//session_destroy();
// end php
die();
 
?>

Open in new window

0
wal_toorAuthor Commented:
Output: Array ( [actionLogged] => flashAction )

Thanks.
0
biztigerCommented:
I execute the code on my server and it works perfectly. There is some kinda php.ini configuration problem.

Check out
http://in2.php.net/manual/en/session.configuration.php

To configure your server properly.
0
biztigerCommented:
Very Sorry for my previous comment. Please ignore it

Use session_write_close() to close the session instead of using session_destroy().
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wal_toorAuthor Commented:
Okay, i will try this right away. Can you explain me the difference between those?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.