/home/ch45859/web/wlkl.ch/public_html/inf/php/sess.php

host lx13.hoststar.hosting
session started 1 []
session_get_cookie_params [lifetime => 0, path => /, domain => , secure => false, httponly => false, samesite => ]
pw tstPassW, endode = dHN0UGFzc1c=
hash tstPassW h1= $2y$10$QqhpPR78Lk5IstGxAQ.JPeaRz2oqNWiincZL58ebsH0E5IPusIExK
hash tstPassW h2= $2y$10$clomvEmhhBjdA1I4bU2yze/DL6nczPQbPEccN3Ga3nJfUHHhjxRZq
crypt pw h1= $2y$10$QqhpPR78Lk5IstGxAQ.JPeaRz2oqNWiincZL58ebsH0E5IPusIExK crypt pw h2= $2y$10$clomvEmhhBjdA1I4bU2yze/DL6nczPQbPEccN3Ga3nJfUHHhjxRZq
auth admin false , cry1= noSxczEfd3c3A , hash2= $2y$10$zqi72chQ5HL1EeCMNp2v4epgMSLL6riiXVgEsZUf8oK0iSTKr.QHu

End sess.php

args

sess.php

/home/ch45859/web/wlkl.ch/public_html/inf/php/sess.php

*** code does not have a span berfore first <br>***
<?php

require_once('env.php');
$sst = session_start();
outBegin(__file__);
out('host', gethostname());
#out("session started $sst", $_SESSION ?? 'undefined');
out("session started $sst", $_SESSION ?? 'undefined');
$_SESSION['eins'] = 'ErstenS';
out('session_get_cookie_params', session_get_cookie_params());
if (is_array(@$_SESSION['authpw'])) {
        # password_hash contains hashMethod and seed, thus it can be reused as seed
        # crypt and password_hash are compatilbe
        # password_hash(from valid PW, PASSWORD_DEFAULT))
    $ph = '$2y$10$PyjclbiTH0uotBC.PVVJ5OdObAKsW40CcJh.8xVz8KcafYjVvvgKa'; # password_hash(from valid PW, PASSWORD_DEFAULT))
    foreach($_SESSION['authpw'] as $k => $v)
        out("$k => $v, decode " . base64_decode($k) . ", crypt=", crypt(base64_decode($k), $ph) === $ph ? 'matches': 'fails'
                        , ", password_verify=", password_verify(base64_decode($k), $ph) ? 'matches': 'fails');
}
$pw = 'tstPassW';
out("pw $pw, endode =", base64_encode($pw));
out("hash $pw h1=",$h1=password_hash($pw, PASSWORD_DEFAULT));
out("hash $pw h2=",$h2=password_hash($pw, PASSWORD_DEFAULT));
out('crypt pw h1=', crypt($pw, $h1), "crypt pw h2=", crypt($pw, $h2));
out('auth admin' , isset($_SESSION[crypt($pw, 'admin')]), ", cry1=",crypt($pw, 'nopass')
        , ", hash2=",password_hash($pw, PASSWORD_DEFAULT));
outEnd(__file__);