Re: References in Sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 14, 2010 at 05:36:29PM +0200, Sebastian Detert wrote:
> Alexander Schrijver schrieb:
> >Is my message unclear? or didn't anyone  ran into this problem?
> >
> If you want an atomic solution, you need to save the session to your
> database. How often do you need to delete data? Isn't it better to
> delete at night when noone is online, or logout all users for some
> minutes while deleting? In addition to that I don't understand, why
> it is important to prevent deletion if a point is selected ... If
> you want to work with something that was deleted, print an error and
> that's it.

Yes, i can use a database. But i can't properly use the SESSION abstraction
with a database.

suppose i build a Session handler which writes to the database it needs to
write to specific tables which contain the proper constraints.

e.g. 

table session
	session_id (PK)

table companies
	company_id (PK)
	session_id -> session(session_id)

i.e. (one to many relationship)

Thus $_SESSION['companies'] = Array(1,2,3) needs to be translated to insert a
row in the companies table.

Now suppose someone does $_SESSION['somethingwhichdoesnexist'] = 'bladiebla'
(which is invalid) i can't make it properly fail. Because the Session handler
is run at a later point.

I can't find a method to properly work around this without rewriting to whole
session handler.

Doing deletions at night isn't solving the problem. Users can exist at night.

Printing an error isn't solving the problem either. What kind of message should
i print? "Something went wrong; i am not entirely sure what but it probably the
administrator deleted or changed a the database. Oh, and your session is now
useless".

This seemed like an obvious problem to me with an obvious solution which i
missed. Nobody has this problem?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux