|
Posted by Erwin Moller on 08/23/06 12:58
Gucci wrote:
> I need to realize such an effect. if one user has login, the session
> will keep until he logout.
> but if i change the set of session.gc_maxlifetime it will take too much
> system resource.
Does it really?
'Inactive' sessions only take up a few bytes in a file in a tempdirectory,
unless you store huge amounts of data in your sessions.
Storing huge amounts of data in a session is bad, so don't. :P
Did you actually measure a system/performance degradation with higher
gc_maxlifetime?
>
> i plan to create a session and insert session_id, session_data into
> database
> and create the cookie set the lifetime = 9999999999
> then when the user visit the site again, i read the cookie first to
> sure has he logined
> and match the data with the database.
Yes, that is the way to go if your want to use 'user' sessionmanagement
instead of 'file' which is PHP default system to store sessions.
Check out www.php.net and look up sessions.
You will find links to user-defined sessionstorage.
You will also find a usefull link to the ZEND website that contains an
example of how to achieve this with a database.
Regards,
Erwin Moller
>
> i don't know the plan will affective or not.
>
> ps. i don't know if i change the value of session.cookie_lifetime,
> which will change the default cookie lifetime in the cookies.
[Back to original message]
|