| 11:09 am on Mar 25, 2003 (gmt 0)|
Have a look at Session Tracking: Part 2 [onlamp.com].
| 2:56 pm on Mar 25, 2003 (gmt 0)|
| 3:11 pm on Mar 25, 2003 (gmt 0)|
Can I somehow include that in .htaccess?
| 7:05 pm on Mar 25, 2003 (gmt 0)|
You may want to add the following lines to a .htaccess file:
php_value session.save_handler user
php_value auto_prepend_file [php.net] "/path/to/file/with/session/code.PHP [php.net]"
This will save you the work of having to include [php.net] the session code on every page.
| 7:37 pm on Mar 25, 2003 (gmt 0)|
| 7:48 pm on Mar 25, 2003 (gmt 0)|
In the example (onlamp page) you showed me, it has the following:
$session_name can be whatever I want (right?) but what about $session_path? What is that supposed to be?
| 7:53 pm on Mar 25, 2003 (gmt 0)|
|The two input parameters $session_save_path and $session_name refer to the configuration directives found in the php.ini. |
But... the save path is what I want to change!?
| 8:27 pm on Mar 25, 2003 (gmt 0)|
mysql_session_open is just a callback function that gets called by PHP [php.net] when a session is opened. PHP [php.net] is so nice as to pass the two $session_save_path and $session_name parameter to your callback function. If you donīt want to use them then donīt. However it is probably good style to use $session_save_path to configure the name of the database and $session_name to configure the table. That way you will not have to change your session code but can simply use the normal php_value/ini_set [php.net] configuration mechanism to use different databases and tables.
So you would do a
In your .htaccess file you would then specify the name of the db and table like so:
php_value session.save_path "mydb"
php_value session.name "mytable"