php - Chrome session data lost -


i'm having problems chrome , php sessions. i'm building oauth2 server going used organization , oauth2 part working when try implement simple login before oauth2 authorization request php session reset everytime refresh page on chrome (already tested firefox, safari , edge).

the favicon not missing since file in root (random favicon found on web since favicon not ready yet, no copyright infringement intended).

my php oauth2 authorize.php:

<?php require_once __dir__.'/server.php';  $request = oauth2\request::createfromglobals(); $response = new oauth2\response();  if (!$server->validateauthorizerequest($request, $response)) {     $response->send();     die; } if(!isset($_session['logged_in_user'])){     $link = (isset($_server['https']) ? "https" : "http") . "://$_server[http_host]$_server[request_uri]";     echo "<script>window.location.href = \"login.php?next=".urlencode($link)."\";</script>";     die(''); } if (empty($_post)) {   exit(' <form method="post">   <label>do authorize testclient?</label><br />   <input type="submit" name="authorized" value="yes">   <input type="submit" name="authorized" value="no"> </form>'); } $is_authorized = ($_post['authorized'] === 'yes'); $server->handleauthorizerequest($request, $response, $is_authorized); $response->send(); 

my login.php:

<?php     if(!isset($_session['logged_in_user'])){         if(empty($_post)){ ?> <form method="post">   <label>do want login testclient?</label><br />   <input type="submit" name="authorized2" value="yes">   <input type="submit" name="authorized2" value="no"> </form> <?php         }else{             $_session['logged_in_user'] = true;             echo "<script>window.location.href = \"".urldecode($_get['next'])."\";</script>";             die('');         }     }else{echo "<script>window.location.href = \"".urldecode($_get['next'])."\";</script>";} ?> 

as can see quite simple code (i'll implement real db fetch login later).

the php library i'm using oauth2 1 bshaffer can find on github, "server.php" file 1 can find in library cookbook.

my php.ini values session : php.ini session values

if wants try access, i'm doing tests via google oauth 2.0 playground.

the setup values playground : playground setup values

does have solution ?

edit 1 : php version i've installed 7.1.8 fpm service on ispconfig 3.1.6

after lot of searching i've found problem...memcache. unknown reason memcache , sessions not work on php installation. other caching systems ok, if activate memcache sessions not working in chrome only.

  • php 7.1.8
  • memcache 3.0.9-dev
  • memcached 3.0.3

i've tried memcache 3.0.8 (stable) result doesn't change...sessions ok not in chrome loses session every page reload.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

php - Cannot override Laravel Spark authentication with own implementation -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -