Sessions in PHP 5.3.3 and kirby -
situation
i have implemented modified version of kirby auth plugin on client website, works way
- user accounts simple kirby content files title serving login , password field containing bcrypt encrypted version of users password
- on website, visitors can click on "customer area", goes template managed modified auth plugin (which redirects "login" form).
- the website multilingual. accounts file
content/extranet/login/login.fr.txt
or examplecontent/extranet/bastian/bastian.fr.txt
, modified auth plugin looking for, finds file , reads it, checks password, , logins users. - this system requires account pages title same url, , invisible pages
- user logged in , can see in « secure » template files present in folder
this works here on local mamp server can see in screenshots, on production server http://www.driving-evolution.com, doesn’t work, , don’t know why, have looked in lot of places , don’t understand going on. (it doesn’t work on staging server either)
on production server, wether enter or bad login, form doesn’t show error message, , doesn’t log user in either. @ first thought maybe because of bcrypt install, not, disabled (and used plain passwords instead) , still didn’t work.
the issue seems not plugin here difference between live php stack , local php stack (my guess on php session handling).
remote php 5.3.3
here sample output of curl on both installations :
working (local)
curl -d "username=test&password=test" -i devo.loc/fr/login http/1.1 302 found date: tue, 27 may 2014 12:59:49 gmt server: apache/2.2.25 (unix) mod_ssl/2.2.25 openssl/0.9.8y dav/2 php/5.5.3 x-powered-by: php/5.5.3 set-cookie: phpsessid=9249a942248a2382d8eb10090bf5d825; path=/ expires: thu, 19 nov 1981 08:52:00 gmt cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 pragma: no-cache set-cookie: authfrontend=mc06csp25; expires=wed, 28-may-2014 12:59:49 gmt; max-age=86400; path=/ set-cookie: phpsessid=b38ec0b342356c2c38778e4a6925f085; path=/ set-cookie: authfrontend=8qyyn; expires=wed, 28-may-2014 12:59:49 gmt; max-age=86400; path=/ location: http://devo.loc/fr/extranet x-ua-compatible: ie=edge vary: accept-encoding content-length: 0 content-type: text/html; charset=utf-8
failing (remote)
curl -d "username=test&password=test" -i www.driving-evolution.com/fr/login http/1.1 200 ok date: tue, 27 may 2014 13:01:32 gmt server: apache x-powered-by: php/5.3.3 expires: thu, 19 nov 1981 08:52:00 gmt cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 pragma: no-cache set-cookie: phpsessid=6j9o1i4djetojtbg444i51efm7; path=/ vary: accept-encoding x-ua-compatible: ie=edge connection: keep-alive, close transfer-encoding: chunked content-type: text/html
useful links
remote phpver : http://www.driving-evolution.com/phpver.php
screenshots when works on local
hope able me on ! ask further info , give it.
turns out problem cms, file caching turned on , not ignoring "login", "logout", , "extranet" files (all related customer area), had add :
c::set('cache.ignore', array('api', 'sitemap', 'extranet', 'account', 'login', 'logout'));
to kirby config (api , sitemap unrelated).
this fixes problem login form cached , not hitting on server. form not cached.
Comments
Post a Comment