hi.. is there any function that save variable to session?

thanks..

Comments

yasir farooqui’s picture

Do you just want to save to and read from sessions? If so then try sess_write($key, $value), and sess_read($key) functions.

marvs’s picture

yah! thanks.. another question. I wil going to track the inviter from the email without invitation code. This is my plan, I will give a link with user id in the email then if he/she click the link then I will save the the user id variable in session. After saving the user id in session I will redirect it to user registration then it's time for tracking. Is this possible? Do have an idea?

abaddon’s picture

it seems you should not use sess_read/write to store session data, use $_SESSION[] directly, those 2 functions are internal and not part of the api, see this
http://drupal.org/node/139587
and if you look at the 2 functions overhead, i dont think theyre meant for single variable storage