» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2006, 04:49 PM
furious furious is offline
OSP Starters
 
Join Date: Jun 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
furious is on a distinguished road
Question New session not generated

For some reason, a new session with a new session id is not being generated after I run my logout.php script. I'm using the code below to kill/destroy the session:

Code:
session_start();
$_SESSION = array();
session_unset();
session_destroy();
header("Location: index.php");

it doesn't matter whether I'm logged in or not, how many times i log in or out or who I log in with, I always get the same session id all the time. I only get a new id when I quit the browser (not just close the tab or window) and re-open it.

What's the problem, point out please.
thanks -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-01-2006, 04:51 PM
strauss strauss is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
strauss is on a distinguished road
Default

comment out the "$_SESSION= array()" line. it is not required.
also, i have never used session_unset(). my sessions work fine.


Code:
session_start();
unset($_SESSION[some_var]); // some_var is the variable that i had set when creating the session
session_destroy();
header("location:index.php");

Hope that helps -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP session hacking webspider PHP Programming and Tips 3 08-23-2006 01:39 PM
session variable overwriting euhoria PHP Programming and Tips 2 08-22-2006 01:01 PM
clear session variable vandort ASP forums and Tips 1 08-11-2006 01:48 PM
Security Safe PHP Session Setup waugh PHP Programming and Tips 2 08-03-2006 05:03 PM
stop indexing PHP SESSION IDs danielle Yahoo 4 03-26-2006 05:34 AM


All times are GMT. The time now is 06:43 PM.