List Info

Thread: note 78653 added to function.session-regenerate-id




note 78653 added to function.session-regenerate-id
user name
2007-10-21 23:15:40
I can't really figure this out, maybe someone can help.

<?php
session_start();
session_regenerate_id(true);

if (isset($_SESSION['data'])) {
	$session = $_SESSION['data'];
} else {
	$session = '';
	$_SESSION['data'] = $_GET['data'];
	session_write_close();
}

echo "Session: $session";
?>

Load the page with "?data=foo" to set some data.
Then delete the query string and load the page again. Now
start refreshing the page, perhaps just hold down F5 and let
it go. Eventually your session data will be lost.

I thought that maybe it was to do with writing the file too
slowly on the server, but it seems much more likely to be
the user's browser writing the cookie too slowly.

You would think that the user would never access a page fast
enough for this to be a problem, but with XmlHttpRequests
going off quickly, it can and does happen.

Unless I'm wrong, I don't think that setting the
delete_old_session parameter to true is a good idea. Just
encrypt your session data and let the garbage collection
take care of things.
----
Server IP: 194.145.210.3
Probable Submitter: 217.42.108.152
----
Manual Page -- http://www.php.net/manual/en/function.session-reg
enerate-id.php
Edit        -- https://master
.php.net/note/edit/78653
Del: integrated  -- h
ttps://master.php.net/note/delete/78653/integrated
Del: useless     -- http
s://master.php.net/note/delete/78653/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78653/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78653/spam
Del: non-english -- 
https://master.php.net/note/delete/78653/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78653/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78653
Reject      -- https://mast
er.php.net/note/reject/78653
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 78653 rejected from function.session-regenerate-id by james
user name
2007-10-22 00:13:58
Note Submitter: Kyle 

----

I can't really figure this out, maybe someone can help.

<?php
session_start();
session_regenerate_id(true);

if (isset($_SESSION['data'])) {
	$session = $_SESSION['data'];
} else {
	$session = '';
	$_SESSION['data'] = $_GET['data'];
	session_write_close();
}

echo "Session: $session";
?>

Load the page with "?data=foo" to set some data.
Then delete the query string and load the page again. Now
start refreshing the page, perhaps just hold down F5 and let
it go. Eventually your session data will be lost.

I thought that maybe it was to do with writing the file too
slowly on the server, but it seems much more likely to be
the user's browser writing the cookie too slowly.

You would think that the user would never access a page fast
enough for this to be a problem, but with XmlHttpRequests
going off quickly, it can and does happen.

Unless I'm wrong, I don't think that setting the
delete_old_session parameter to true is a good idea. Just
encrypt your session data and let the garbage collection
take care of things.

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )