• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After Updating from CI 2.s to CI 3.x strange caching/session issues?

#1
Bug 
I have a site that has been running on CodeIgniter for the last 2 years and I wanted to upgrade it to use the latest version of CodeIgniter 3.06.

I upgraded my site like the following.

/mysite/memberpages   <- is the old site running CodeIgniter 2.X

/mysite/member <- is running the new version of CodeIgniter 3.06

This way I could test the new version without any members knowing what I am doing.

Here is how I upgraded.  I downloaded the latest version and uploaded it to the "member" directory

I copied all the views, Libraries, Models, and Controllers from the old install and modified the files including the new config files, to connect to the database and routeing using my IDE,  I am testing it now and it appears that everything is working  but I have found some issues that may be due to the upgrade or a bug or something not configured correctly.

After upgrading I have found an issue.

Is this Caching the Pages Or Sessions?  http://screencast.com/t/Z4QWrCRdDm


I don't see where to keep the site from caching everything.  It's so bad my ajax queries are not updating.  It seems that all pages are caching automatically and I have to delete the cache files before they update.

Has anyone else had this issue before ?
Reply

#2
Well it seems that those Caching Issues was not caching issues at all.. Or was it?


The problem is that my upgrading from CodeIgniter 2.x to 3.x my ajax site was not updating..

After looking at the Docs here.  http://www.codeigniter.com/user_guide/li...sions.html

I found out that Encrypted Cookies are no longer.  By default the sessions are stored as files.

after looking in config.php  I found


PHP Code:
$config['sess_save_path'] = ''

I am guessing since I did not set this value that it just picked the root to store the session value.

What I did not understand is why the sessions never updated.  I had values over 24 hours that seemed like a caching issue.

Here is what I did to fix the issue.

I created a directory called sessions in my /application folder so it looks like this /application/sessions and chmod the directory 700

PHP Code:
$config['sess_save_path'] = '/homepages/3/d585779333/htdocs/mysite/application/sessions/'


This fixed my issue but what's weird is nothing is stored in the sessions folder and everything seems to be working just like CI 2.x did.

I am just not exactly sure why it worked or why nothing is populating in the sessions folder.
Reply

#3
Try changing the directory owner to www-data. chown www-data /path/to/sessions
Reply

#4
(04-23-2016, 09:51 AM)dave friend Wrote: Try changing the directory owner to www-data. chown www-data /path/to/sessions

I went back and tripple checked my path then realized that I had the wrong path...  instead of 

PHP Code:
$config['sess_save_path'] = '/homepages/3/d585779333/htdocs/mysite/application/sessions/'

should have been

PHP Code:
$config['sess_save_path'] = '/homepages/3/d585779333/htdocs/mysite/member/application/sessions/'

Now sessions are populating again.

Instead of a directory like this Controler+Function

They are showing like this.

ci_session495749bfe5a1c45d1efd48b0b7a98276a6e75e05
ci_session65259b14a92cc910d8e94e8286d51205d54fe5e1

Seems to be working so far.
Smile
Reply

#5
The  way I set the path was like below:

Quote:$config['sess_save_path'] = APPPATH.'/sessions'
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#6
(04-23-2016, 11:06 AM)InsiteFX Wrote: The  way I set the path was like below:

Quote:$config['sess_save_path'] = APPPATH.'/sessions'


yes that works also.

it's odd that if this setting is not set it acts like full page caching where the values never seem to update unless you delete it..

I am glad that I did not give up on this.  I just need to brush up on the new features.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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