Hi!
I'm still in the learning phase (php) and would like to know if I have to use sessions inside modules in any special way to make them work.
I want to have a flood protection. Is it the right way to use sessions in this case?
Krol
Sessions inside modules
Re: Sessions inside modules
No, there is no 'special way' how to use session variables in module. You only have to be careful and do not name Your session variable equally as any session variable which is used by CMSMS (or by other module). To be absolutely sure, combine Your session variable name with $id of Your module. Best way for set/access session variable is using of PHP superglobal variable $_SESSION - in this way Your script will work regardless of 'register_globals' setting of Your PHP environment.Krol wrote: if I have to use sessions inside modules in any special way
Old way by PHP function session_register() is not recommended.
Take a look here: http://www.php.net/manual/en/reserved.v ... es.session
Last edited by 100rk on Thu Mar 10, 2005 5:35 pm, edited 1 time in total.