Rectangle 27 0

javascript why i can't unset session in php?


don't know why have you session variable in script without any reason 2ndly i think when ever you load you page your variable is assigned and that may be the reason that it sets again. put some kind of check when you intializing or assigning your variable.

Note
Rectangle 27 0

javascript why i can't unset session in php?


First of all I'm going to write my question in brief. I wanted to catch a event and wanted to use the event to store some value in my session to recognize that event in rest of my site unless the session is destroyed by somehow. Al the variables used in .php file stores value in them and execute all operations when they are on the server. Browser displays the result. How can we expect while a user do something [in my case clicked] and it simply store a value in a php variable while there are no php variables inside the browser. So what can we do is simply store the result in a javascript variable or go back to server and set the value to the variable. To call the server using ajax is a method of experts and honestly speaking I don't know much of it. So I needed to look for something what i already know. Of course based on php. Finally I got the COOKIE. To catch the event its obvious to use javascript. I used a event listener using jQuery and inside it I store a value in my browser's cookie. and then used both javascript and php to check the cookie in my website. This has a fallback. If user disables the cookie then you won't have the option to use it.

Note