I have redesigned a big project in favour of sessions to keep track of my variables. The thing is one variable (not all) is incrementing by 1 everytime I start a session.
I cant find any reason for it whatsoever! On every page I test, it increments it by 1. There is no code or counters going... nothing!
The variable is $aff_id - it also comes in via the URL but so do other variables but they do not increment.
Any ideas?
Lawrence.
ps I think it is related to me not destoying sessions as I test the script. I think it is keeping an old value.
Im quitting sessions!
Moderator: General Moderators
- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany
You must be increasing the variable somewhere... they don't change unless you tell them to!
When you destroy a session make sure you unset the variables before destroying it... session_unset(); session_destroy();
Don't forget you all need session_start() at the top of each page which you know will need to access the session variables.
When you destroy a session make sure you unset the variables before destroying it... session_unset(); session_destroy();
Don't forget you all need session_start() at the top of each page which you know will need to access the session variables.
Its very hard to test as now it works ok despite not working correctly yestoday. I am trying to re-create the variables and the the order I tested it but now it annoyingly works like a charm.
I think im going to destroy_session using a sub-script before starting a session every single time now.
It would be nice to destroy_session when the user leaves the domain - anyone know how to do that?
Lawrence.
I think im going to destroy_session using a sub-script before starting a session every single time now.
It would be nice to destroy_session when the user leaves the domain - anyone know how to do that?
Lawrence.