# |
Jul 4th 2018, 11:28 |
josbeir |
but if we are talking about marshalling, beforeMarshal will probably be fine in most cases i think |
# |
Jul 4th 2018, 11:27 |
josbeir |
not really, beforeSave can be used to perform controller logic before saving |
# |
Jul 4th 2018, 11:27 |
lubos |
but since it is in model, as you said (again correct) than this is nonsense event |
# |
Jul 4th 2018, 11:27 |
lubos |
http://crud.readthedocs.io/en/latest/events.html#crud-beforesave |
# |
Jul 4th 2018, 11:27 |
lubos |
like Crud.beforeSave |
# |
Jul 4th 2018, 11:26 |
lubos |
i meant if there is something like Crud.beforeMarshal event |
# |
Jul 4th 2018, 11:26 |
josbeir |
so that should work |
# |
Jul 4th 2018, 11:26 |
josbeir |
beforeMarshal is in the table, not controller |
# |
Jul 4th 2018, 11:25 |
lubos |
just trying to do workaround for form helper _ids which does not support joinData |
# |
Jul 4th 2018, 11:25 |
lubos |
anyone using Crud plugin, how to adjust data before marshaling? there is no such event as beforeMarshal. so I guess in edit I just do if request is put then and adjust data, right? |
# |
Jul 4th 2018, 11:24 |
lubos |
:+1: |
# |
Jul 4th 2018, 11:23 |
josbeir |
;) |
# |
Jul 4th 2018, 11:23 |
david |
thank you so much |
# |
Jul 4th 2018, 11:23 |
david |
x 60 solves it :slightly_smiling_face: |
# |
Jul 4th 2018, 11:23 |
david |
that was the problem |
# |
Jul 4th 2018, 11:22 |
josbeir |
after the browser closes that is. |
# |
Jul 4th 2018, 11:22 |
lubos |
but app.php.default comment is clear, it says minutes so @david just try to multiple ini configuration * 60, it might help |
# |
Jul 4th 2018, 11:22 |
josbeir |
anyway, on a side note, its not the best practice to persist sessions |
# |
Jul 4th 2018, 11:21 |
josbeir |
;) |
# |
Jul 4th 2018, 11:21 |
lubos |
@josbeir you are right, i just mixed minutes and seconds :slightly_smiling_face: sorry |
# |
Jul 4th 2018, 11:21 |
neon1024 |
Especially with mixed configuration |
# |
Jul 4th 2018, 11:21 |
neon1024 |
This use-case is a good highlight of your point @lubos |
# |
Jul 4th 2018, 11:20 |
josbeir |
timeout is minutes so that is correct |
# |
Jul 4th 2018, 11:20 |
lubos |
we were discussing this before, might be confusing use sometimes seconds sometimes minutes |
# |
Jul 4th 2018, 11:20 |
lubos |
rather 1440/60 for `Session.timeout` |
# |
Jul 4th 2018, 11:19 |
josbeir |
you should indeed to 1440*60 for the ini config |
# |
Jul 4th 2018, 11:19 |
neon1024 |
So perhaps your cake setting is 1440 minutes, and your ini setting is 1440 seconds |
# |
Jul 4th 2018, 11:18 |
neon1024 |
As I’m certain the Cake setting is minutes, and the ini setting is seconds |
# |
Jul 4th 2018, 11:18 |
neon1024 |
Or your Auth config, conflicts with your PHP session lifetime ini setting |
# |
Jul 4th 2018, 11:18 |
neon1024 |
I would imagine that your configuration is incorrect then |
# |
Jul 4th 2018, 11:17 |
josbeir |
because by default the cookie expires when the browser session is closed |
# |
Jul 4th 2018, 11:16 |
josbeir |
and the cookie experiation time is also correct? |
# |
Jul 4th 2018, 11:16 |
david |
yes, it is. If I browse or have any activity, I dont lose the session |
# |
Jul 4th 2018, 11:16 |
josbeir |
is the cookie being set? |
# |
Jul 4th 2018, 11:15 |
david |
any idea on what I am doing wrong? |
# |
Jul 4th 2018, 11:14 |
david |
the expected time was 1440 minutes (24 hours) |
# |
Jul 4th 2018, 11:14 |
david |
but if there is no activity, users loses sessions very soon |
# |
Jul 4th 2018, 11:13 |
david |
File uploaded https://cakesf.slack.com/files/UAPU3DV3J/FBJR7K0PL/i_have_this_setup_for_my_sessions_in_app_php.php / https://slack-files.com/T053DPNCM-FBJR7K0PL-c08ee6016b |
# |
Jul 4th 2018, 11:12 |
david |
morning |
# |
Jul 4th 2018, 11:11 |
lubos |
So when using crud plugin, I would just adjust submitted data on beforeSave event |
# |
Jul 4th 2018, 11:09 |
lubos |
Form helper ``` // Multiple select element for belongsToMany // Does not support _joinData ``` I need to add some joinData, what is the best approach? In the controller? |