• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lost session

#11
(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
Reply

#12
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
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

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

#14
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#15
still same behaviour
Reply

#16
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#17
Also please make sure you're using the latest version of the develop branch.
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4
Reply

#18
(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
Reply

#19
(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
Reply

#20
(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
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.