cookies - Restore a php session with saved session id? -



cookies - Restore a php session with saved session id? -

i want restore php session variables before session using value hashed , salted , stored in cookie. utilize value retrieve old session id , seek load session.

if(isset($_cookie['user'])) { $user = sanitizestring($_cookie['user']); $result = querymysql("select sessionid cookie user='$user'"); if ($result->num_rows == 1) { $row = $result->fetch_array(mysqli_assoc); //echo $row['sessionid']; $storeresult=$row['sessionid']; session_id($storeresult); } } session_start();

of existing posts on stackoverflow, on point how restore php session? doesn't address retrieving sessions have not been deleted server. long sessions still on server, shouldn't able reload them these 2 lines of code?

session_id($storeresult); session_start();

right see cookie set session variables (e.g. $_session['votes']) never set. doing closing browser , reopening, time after initial session minimal.

from prior postings, there doesn't seem direct way check whether session particular id exists. other suggestions troubleshooting this? give thanks you.

php cookies session-variables

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -