Session lifetime

Permalink
Hi!
I'm learning to use session variables with Concrete5 and I found this guide:https://documentation.concrete5.org/tutorials/session-handling-and-g... It works great.

But how do I know how long is the session cookie lifetime? And is it possible to extend the time to be longer, for example 24 hours (assuming that user keeps browser open the whole time)?

mandako
 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Have you looked here
index.php/dashboard/system/optimization/cache
scroll to the bottom of the page and make your changes there.
mandako replied on at Permalink Reply
mandako
Oh right, thank you! I looked there, and it's now set on default 6 hours.

Is there a way to add different time for a specific page or page type? I don't think I want to make it 24 hours for the whole website.
mandako replied on at Permalink Reply
mandako
I just found that there is "Caching" option in page settings, so I can set different time for a specific page. But I'm still wondering is it possible to make somehow automatic, that if specific type of page is created, it automatically is set to use 24h caching?
surefyre replied on at Permalink Reply
surefyre
Really?

Cache expiry is used to change the session lifetime?

How would anyone ever assume that?
mandako replied on at Permalink Reply
mandako
Changing caching time from index.php/dashboard/system/optimization/cache did not help.

Then I tried to add this to application/config/concrete.php and it worked:
<?php
return array(
    'session' => array(
        'max_lifetime' => 86400, // seconds. Default was 7200
        'cookie' => array(
          'cookie_lifetime' => 86400, //seconds. Default was 0
         ),
    ),
);

Now session variables last 24 hours, if user keeps browser open. But is this good practice, can I leave it like that?

And if anyone knows how I can apply this longer session lifetime for only one page type, it would be even better.