comparison php/requestKey.php @ 3028:9a201c63a0eb

Implementation for #231
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 19 Sep 2017 20:26:54 +0300
parents 8805556c0f42
children 53d701288da5
comparison
equal deleted inserted replaced
3027:b09e9b7ef246 3028:9a201c63a0eb
7 $randomString = ''; 7 $randomString = '';
8 for ($i = 0; $i < $length; $i++) { 8 for ($i = 0; $i < $length; $i++) {
9 $randomString .= $characters[rand(0, $charactersLength - 1)]; 9 $randomString .= $characters[rand(0, $charactersLength - 1)];
10 } 10 }
11 return $randomString; 11 return $randomString;
12 }
13
14 if (!file_exists("../saves")) {
15 mkdir("../saves");
12 } 16 }
13 17
14 // Request a new session key from the server 18 // Request a new session key from the server
15 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); 19 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
16 header("Cache-Control: post-check=0, pre-check=0", false); 20 header("Cache-Control: post-check=0, pre-check=0", false);