Log message #4113699

# At Username Text
# Feb 2nd 2018, 13:22 hmic thats a php thing and known forever
# Feb 2nd 2018, 13:22 hmic k4t: file sessions are not concurrent.
# Feb 2nd 2018, 13:21 k4t for storing sessions
# Feb 2nd 2018, 13:21 k4t instead of forcing users to use some kind of cache engines
# Feb 2nd 2018, 13:21 k4t to be honest I understand the problem, and security reasons behind session renew logic, but is it possible to fix it somehow on framework side?
# Feb 2nd 2018, 13:20 k4t as such thing can happen
# Feb 2nd 2018, 13:19 k4t does it means that keeping session in files in completely useless?
# Feb 2nd 2018, 13:19 hmic slaps k4t
# Feb 2nd 2018, 13:18 k4t @admad as a workaround I started writing directly to $_SESSION :(
# Feb 2nd 2018, 13:17 hmic let me try
# Feb 2nd 2018, 13:17 hmic makes sense
# Feb 2nd 2018, 13:17 admad k4t: your problem seems to happen because the session file if still locked from previous request when new request is made. I would suggest using a cache engine backed session instead of default file based sessions
# Feb 2nd 2018, 13:14 admad *_setupHelpers()
# Feb 2nd 2018, 13:14 admad hence my suggestion to update _setHelpers() to modify $helpers instead of loading helpers directly through loadHelper()
# Feb 2nd 2018, 13:13 admad hmic: loadHelper() does, but CrudView loads it's custom helpers through initialize() which is called before loadHelpers() hence the aliases already loaded are ignored
# Feb 2nd 2018, 13:10 k4t I found some similar problems on GitHub: https://github.com/cakephp/cakephp/issues/5988 Unfortunetelly they do not solve my case.
# Feb 2nd 2018, 13:10 k4t I am using Cake 3.1.14, PHP 5.6. Session cookies are handled by Cake, but the same problem appear when I change it to php.
# Feb 2nd 2018, 13:09 k4t I discovered that error is caused by Cake session renew logic, exactly by that line in Session.php Cake file: session_regenerate_id(true); When I set session_regenerate_id flag to false then everything is fine (becuase session file is not deleted). This happens when I am writing to session via $this->Auth->setUser($user) (but it is random);
# Feb 2nd 2018, 13:09 k4t Guys I have big issue with session in CakePHP, when I keep opening multiple tabs in browser fast then session is lost and following error is displayed: "session_regenerate_id(): Session object destruction failed". Here is more detailed log: https://gist.github.com/K4T/6584c957355da498c18d260abd1a4ddd
# Feb 2nd 2018, 13:05 hmic actually, maybe even loadHelper should consider viewbuilder itself...
# Feb 2nd 2018, 12:59 admad you can make a PR :slightly_smiling_face:
# Feb 2nd 2018, 12:59 admad hmic: having helper config through viewBuilder take precedence can be achieved if _setupHelpers() was changed to check and modify $helpers property instead of using loadHelper()
# Feb 2nd 2018, 12:58 hmic i think it's an easy fix to make that work
# Feb 2nd 2018, 12:58 hmic i would have expected that way to work to inject my overwritten crudviewhelper into crudview...
# Feb 2nd 2018, 12:57 hmic i usually don't either. but it seems to be the way to inject helpers in a custom viewclass
# Feb 2nd 2018, 12:54 admad hmic: yes i have extended CrudView and overridden _setupHelpers() method. I personally don't use viewBuilder in controller to manage helpers
# Feb 2nd 2018, 12:48 max775 yeaaah I noticed that... damn stuff... everything is working besides this shitty date XD ok ill try to get everything to UTC and see if its working thenˆ^ thanks
# Feb 2nd 2018, 12:46 openmail_slack The DB should always be UTC. Then make sure that you only put UTC times into the DB (convert or run the server on UTC). Then output the date on the page by the setting your user (in his settings) or you as app creator have chosen. Internally in your you only want to talk in UTC, everything else is PITA
# Feb 2nd 2018, 12:46 max775 hmm okˆ^ then Ill have to ask my boss if we can change the server timezone to UTC ;) is just the question if this does conflict with the other running systems on the serv currently its CET
# Feb 2nd 2018, 12:44 hmic everything else should always, always, always be UTC ;)
# Feb 2nd 2018, 12:44 hmic you decide which timezone to display *on output* to the client and on it's behalf only
# Feb 2nd 2018, 12:43 hmic max775: your server should be utc, your database should be and your app should be too
# Feb 2nd 2018, 12:43 max775 ahh so I need to set the same as my server as timezone? Or is UTC ok?
# Feb 2nd 2018, 12:42 hmic admad: so the solution is to extend the helper *and* view to load it, like you would anyway expect when using the viewbuilder?
# Feb 2nd 2018, 12:40 openmail_slack Also note the `timezone` option at https://book.cakephp.org/3.0/en/orm/database-basics.html#configuration
# Feb 2nd 2018, 12:38 max775 lets see if this changes sth :slightly_smiling_face:
# Feb 2nd 2018, 12:36 max775 hmm thanks Ill try that, Ill change all zones to UTC in my app, the server is set to CET
# Feb 2nd 2018, 12:35 neon1024 When using `bin/cake plugin assets symlink` is the intention to commit the resulting symlinks to your repo? I’ve added the command to my Composer `post-install-cmd` and I keep getting errors for missing plugins, because they are dev dependency plugins, like Bake and DebugKit
# Feb 2nd 2018, 12:33 openmail_slack The best practice is to run the DB as UTC (all dates stored as UTC). Then the app converts the date to the required timezone (e.g. server timezone).
# Feb 2nd 2018, 12:30 slackebot db. Can somebody maybe help me, or somebody had a similiar problem?
# Feb 2nd 2018, 12:30 max775 Hello guys, I have a question... Im trying for some hours now to solv a problem Im having with saving timestamps as date in a mysql table with the patchEntity() and save() method. But the problem is that the CORRECT! timestamp is always saved 1 date to early.... I checked all the timezones on the server and also in my cakephp instance and they are all set to CET and also cake php echos the timestamp as correct date, just saves it wrong to my