Welcome Guest, Not a member yet? Register   Sign In
[SOLVED: USER ERROR] CI3 sess_time_to_update and flashdata
#6

I've done some more testing.  I'm using fresh install of CI 3.0.2 with WAMP Apache 2.4.9, PHP 5.5.12, MySQL 5.6.17.  At the bottom are steps to produce what I'm seeing


I'm able to use database sessions with the sess_time_to_update set 10 seconds with no problems.  All session data including flashdata(if I use keep_flashdata) carries over to the next session ID when refreshing the page.  But when using files I cannot keep any session data at all using any amount of time other than 0.  

I've attached screenshots of errors I'm getting that may be causing the issue with files.  I'm getting an fopen error when it tries to create the initial session file.  If I keep refreshing I get a touch error until the 10 seconds are up then I get the fopen error again when it tries to create the new session ID file.  Upon that creation of the next session ID file is when it loses ALL session data.

So I'm assuming there is a bug in the Session library when dealing with Files sessions.  Can anyone else either confirm or set me straight?


  1. create fresh install of CI 3.0.2
  2. autoload session library
  3. set session to files and choose location of file saving
  4. set sess_time_to_update to 10 seconds
  5. in welcome controller add the following to index function
  6.       print_r($this->session->all_userdata());
          print_r($this->session->flashdata());
          $this->session->keep_flashdata("testflash");
  7. in another controller of your choice(I'll call it setsession) enter the following into index function
  8.       $this->session->set_userdata(array("test"=>"testing"));
          $this->session->set_flashdata(array("testflash"=>"testing"));
  9. load welcome controller.  There should be no data other than array with __ci_last_regenerate set
  10. load setsession controller.  nothing will display
  11. load welcome controller again array should now contain userdata with key "test" and flashdata with key "testflash
  12. keep reloading welcome controller and wait for __ci_last_regenerate to change.  Once it changes reload controller one last time.  Session data will be lost.
  13. Repeat steps 9-12 with database session and session data will not be lost.


Attached Files Thumbnail(s)
       
Reply


Messages In This Thread
RE: CI3 sess_time_to_update and flashdata - by henesnarfel - 10-12-2015, 01:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB