CodeIgniter Forums
Lost session - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Lost session (/showthread.php?tid=70509)

Pages: 1 2 3 4


RE: Lost session - scalla - 04-21-2018

(04-21-2018, 08:50 AM)dave friend Wrote: I think you are asking the right question. Something in the session config is not correct resulting in "lost" sessions.

I'm not truely up to speed with CI 4 but I think your $sessionDriver value looks wrong. Try this.

PHP Code:
public $sessionDriver 'files'

And as @InsiteFX suggests, make sure the file path is correct. Of particular importance is that only absolute paths are supported for $sessionSavePath.

following the current codeigniter Doc, u might get things wrong. i look inward of the code.

$sessionDriver is expected to be a class


RE: Lost session - InsiteFX - 04-21-2018

This is how my Sessions are configured.

PHP Code:
public $sessionDriver            'CodeIgniter\Session\Handlers\FileHandler';
public 
$sessionCookieName        'fx_session_';
public 
$sessionExpiration        7200;
public 
$sessionSavePath          WRITEPATH.'temp/'//null;
public $sessionMatchIP           false;
public 
$sessionTimeToUpdate      300;
public 
$sessionRegenerateDestroy false



RE: Lost session - scalla - 04-21-2018

same way i made mine, but seems the session does not role well it ajax


RE: Lost session - InsiteFX - 04-22-2018

Try one of these in your Ajax and see if it makes any difference.

NOTE:

Code:
$_SERVER['HTTP_X_REQUESTED_WITH'] is the golden ticket but not all servers provide this variable
so having other checks in place will be important.

Try:

Code:
request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
// or
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

Let me know what happens.


RE: Lost session - scalla - 04-22-2018

still same behaviour


RE: Lost session - InsiteFX - 04-22-2018

I looked at the CI 4 Session.php file and it does check for 'X-Requested-With' in it.

Are you using the newest version of CI 4?

Use the developers tools in your browser to see what is happening.


RE: Lost session - kilishan - 04-22-2018

Also please make sure you're using the latest version of the develop branch.


RE: Lost session - scalla - 04-23-2018

(04-22-2018, 02:56 PM)InsiteFX Wrote: I looked at the CI 4 Session.php file and it does check for 'X-Requested-With' in it.

Are you using the newest version of CI 4?

Use the developers tools in your browser to see what is happening.

would look into that


RE: Lost session - scalla - 04-23-2018

(04-22-2018, 07:50 PM)kilishan Wrote: Also please make sure you're using the latest version of the develop branch.

you sure bet, am always updated


RE: Lost session - scalla - 04-23-2018

(04-22-2018, 02:56 PM)InsiteFX Wrote: I looked at the CI 4 Session.php file and it does check for 'X-Requested-With' in it.

Are you using the newest version of CI 4?

Use the developers tools in your browser to see what is happening.

I looked into it, it shows nothing of value