晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/akaindir/public_html/crm/libraries/adodb/session/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/akaindir/public_html/crm/libraries/adodb/session/adodb-sess.txt
John,

I have been an extremely satisfied ADODB user for several years now.

To give you something back for all your hard work, I've spent the last 3
days rewriting the adodb-session.php code.

----------
What's New
----------

Here's a list of the new code's benefits:

* Combines the functionality of the three files:

adodb-session.php
adodb-session-clob.php
adodb-cryptsession.php

each with very similar functionality, into a single file adodb-session.php.
This will ease maintenance and support issues.

* Supports multiple encryption and compression schemes.
  Currently, we support:

  MD5Crypt (crypt.inc.php)
  MCrypt
  Secure (Horde's emulation of MCrypt, if MCrypt module is not available.)
  GZip
  BZip2

These can be stacked, so if you want to compress and then encrypt your
session data, it's easy.
Also, the built-in MCrypt functions will be *much* faster, and more secure,
than the MD5Crypt code.

* adodb-session.php contains a single class ADODB_Session that encapsulates
all functionality.
  This eliminates the use of global vars and defines (though they are
supported for backwards compatibility).

* All user defined parameters are now static functions in the ADODB_Session
class.

New parameters include:

* encryptionKey(): Define the encryption key used to encrypt the session.
Originally, it was a hard coded string.

* persist(): Define if the database will be opened in persistent mode.
Originally, the user had to call adodb_sess_open().

* dataFieldName(): Define the field name used to store the session data, as
'DATA' appears to be a reserved word in the following cases:
	ANSI SQL
	IBM DB2
	MS SQL Server
	Postgres
	SAP

* filter(): Used to support multiple, simulataneous encryption/compression
schemes.

* Debug support is improved thru _rsdump() function, which is called after
every database call.

------------
What's Fixed
------------

The new code includes several bug fixes and enhancements:

* sesskey is compared in BINARY mode for MySQL, to avoid problems with
session keys that differ only by case.
  Of course, the user should define the sesskey field as BINARY, to
correctly fix this problem, otherwise performance will suffer.

* In ADODB_Session::gc(), if $expire_notify is true, the multiple DELETES in
the original code have been optimized to a single DELETE.

* In ADODB_Session::destroy(), since "SELECT expireref, sesskey FROM $table
WHERE sesskey = $qkey" will only return a single value, we don't loop on the
result, we simply process the row, if any.

* We close $rs after every use.

---------------
What's the Same
---------------

I know backwards compatibility is *very* important to you.  Therefore, the
new code is 100% backwards compatible.

If you like my code, but don't "trust" it's backwards compatible, maybe we
offer it as beta code, in a new directory for a release or two?

------------
What's To Do
------------

I've vascillated over whether to use a single function to get/set
parameters:

$user = ADODB_Session::user(); 	// get
ADODB_Session::user($user);		// set

or to use separate functions (which is the PEAR/Java way):

$user = ADODB_Session::getUser();
ADODB_Session::setUser($user);

I've chosen the former as it's makes for a simpler API, and reduces the
amount of code, but I'd be happy to change it to the latter.

Also, do you think the class should be a singleton class, versus a static
class?

Let me know if you find this code useful, and will be including it in the
next release of ADODB.

If so, I will modify the current documentation to detail the new
functionality.  To that end, what file(s) contain the documentation?  Please
send them to me if they are not publically available.

Also, if there is *anything* in the code that you like to see changed, let
me know.

Thanks,

Ross


haha - 2025