Welcome Guest, Not a member yet? Register   Sign In
Setting sess_save_path correctly
#8

(This post was last modified: 05-28-2018, 06:19 AM by dave friend.)

(05-26-2018, 03:40 PM)n2fole00 Wrote: Oh, I see BASEPATH points to the system folder and APPPATH points to the application folder. I assumed BASEPATH would be one level up from the application folder (so the root folder). It's probably wiser to have it in the application folder like you have it. Thanks.

Actually having the session files in a non-public folder, a folder above the folder where "index.php: is found, is generally considered to be a good idea. Consider the following folder structure.

Code:
/www  
   /application
   /system
   /any_others
   index.php
/sessions

Where www is the "public" folder for the site

You can easily set the sess_save_path with the following

PHP Code:
$config['sess_save_path'] = substr(FCPATH0strpos(FCPATH'www/')) . 'sessions/'[); 

FCPATH is the folder where index.php is found.
   
Obviously, if your "public" folder has some other name, e.g. 'htdocs', then replace 'www/' with 'htdocs/'.
Reply


Messages In This Thread
Setting sess_save_path correctly - by n2fole00 - 03-05-2016, 08:45 AM
RE: Setting sess_save_path correctly - by Narf - 03-05-2016, 12:59 PM
RE: Setting sess_save_path correctly - by MikeDiz - 05-30-2018, 01:18 AM
RE: Setting sess_save_path correctly - by MikeDiz - 05-30-2018, 01:20 AM
RE: Setting sess_save_path correctly - by dave friend - 05-27-2018, 07:19 AM
RE: Setting sess_save_path correctly - by MikeDiz - 05-30-2018, 03:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB