Reputation: 1126
The following occurs on Chrome, but works perfectly on IE.
a.php
<?php
session_start();
$_SESSION['name1'] = 'value1';
b.php
<?php
session_start();
echo $_SESSION['name1'];
After running a.php
, I closed the browser and opened a new Chrome window to run b.php
.
I was surprised it displayed value1
.
The problem is why the session is still alive when I close the browser? How to fix it? I want the session being killed when the browser closed.
Upvotes: 1
Views: 635
Reputation: 1852
Since it works in IE I would guess the problem in Chrome is because of this feature/design choice:
http://code.google.com/p/chromium/issues/detail?id=128513
Especially comment#2 is relevant. Do you have "Continue where I left off" activated in Chrome settings?
Upvotes: 1