Commit b5277b71 authored by Richard Mansfield's avatar Richard Mansfield

Revert "Remove temporary session folder code (bug #817940)"

This reverts commit 8e8132fb.

That commit was not ready to be merged.  As it says in the commit
message, "if the session directory goes away somehow between updates,
there is currently _no_ way to restore it without one of these two
options. This may need to be considered before merging in this
change."

We can revert this revert when we have a good alternative for creating
the session directories.

Change-Id: I5141832da3225e202feef19dccabfea9ff35beeb
parent 99b2161c
......@@ -44,6 +44,22 @@ if (is_https()) {
ini_set('session.cookie_secure', true);
}
// Attempt to create session directories
$sessionpath = get_config('dataroot') . 'sessions';
if (!is_dir("$sessionpath/0")) {
// Create three levels of directories, named 0-9, a-f
$characters = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
foreach ($characters as $c1) {
check_dir_exists("$sessionpath/$c1");
foreach ($characters as $c2) {
check_dir_exists("$sessionpath/$c1/$c2");
foreach ($characters as $c3) {
check_dir_exists("$sessionpath/$c1/$c2/$c3");
}
}
}
}
/**
* The session class handles session data and messages.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment