Cookbook lets me down once again

The default session was a bit short for me. I expected this would be a setting in app.php. Not finding it in there, I went to the cookbook.

The chapter on sessions has this to say on the topic:

Session Configuration
Session configuration is stored in Configure under the top level Session key, and a number of options are available:

Configure? How? What? Where. You can’t even click on Configure to find out what and where this is.

Ok, so let’s go to the chapter after installation called ‘Configuration’. Surely this will help.


The only thing this chapter has to say about configuring your session is to “See the Session Configuration for information on configuring session handling in CakePHP.” which links right back to the chapter on Sessions that never actually tells you how to achieve this.

What can we do to improve the 3.x documentation? The code itself performs fantastically and lots of enhancements are brilliant, but getting the understanding needed to make it work has been a truly an abysmal experience that keeps making me want to hang up my hat and go back to the .NET of my misspent youth… or something.

Before writing this missive, I did read the comments at the bottom of app.php and found tucked away in there the line that indicated how to set the session timeout. I missed this entirely because I expected the default timeout value to be explicitly set and I was looking for that exact piece of code and never saw it.

Wouldn’t it be SO MUCH EASIER to write in the cookbook:

Session Configuration
Session configuration is defined /config/app.php… available options are listed in the comment block preceding the default setting

I used to use cake, left it, laravel got out of hand. I am trying cake again. I agree the docs can be vague on things. But I always seem to find answer from google, usually a stackoverflow answer.

1 Like


Thanks for answering your own question. The code in the app.php worked for me when i set the session timeout.

However, I tried to display the timeout using $this->request->session()->read(‘Config.timeout’); and it was null.

I expected to see the time that the session would expire. Not sure if that is an accurate expectation though as the docs are indeed confusing.

So given that you can set the session timeout and other things in the app.php, what is all this Config stuff in the docs about?

Now I’m off to answer my own question about guest checkout design.


Thanks for the suggestion, I’ve opened a pull request to update the docs.

1 Like