• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter4 - xhr/ajax request refreshing session expire time

#1
Hello,

I have problem with session expire parameter, when sending Ajax to server expire time is refreshed - so session never expire.
Like screen (look at 'expires' parameter of cookie):

[Image: qnMRbQk.png]
Reply

#2
See HTTP incoming request isAjax();

Also you should do a session write close before executing Ajax.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
Hi,

Yes, isAjax() returns true.

In steps:

1. I create session in BaseController.
2. Display some view with jQuery.
3. This view sends Ajax in 10 secs interval.
4. Effect = every interval runs \CodeIgniter\Session\Session->setCookie method and then rewrite expiration time with new (mayby this is bug?).

Now I find solution for this, override this method by own:
[Image: eZ69hkn.png]
Reply

#4
If it is a bug then I would report it on GitHub.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#5
Yes, I think it is, it should be checking current session expire time and set it or not changing session cookie, other cookie functionality work fine, but expire time refreshing.

EDIT: Report on github created.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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