How to change the time when a session expires?

I am using CakePHP 2.5.4

I have a web page which uses authentication with a timeout configured in /app/Config/core.php so that the session expires in 30 minutes.

The problem is that if I am entering data in a form and I go in the middle of that load and the session expires, as it should, it sends me to the authentication page, and when I log in, it redirects me to the form that was loading data but losing which I had already loaded.

My question is the following:

  1. Any idea how I can do so that after the session expires and I re-authenticate, the data I had previously entered will not be lost?

  2. The timeout time configured in app / Config / core.php sets the time it lasts without expiring the session use or not use the system. Any way that the defined time of 30 minutes is dynamic? I mean that the session expires after 30 minutes in which the system is not used (ie, do not move mouse or press any key)