我需要从javascript中删除某个会话变量
问题描述:
I need to erase a certain session variable from a javascript function how can i do this?
我需要从javascript函数中删除某个会话变量我该怎么做? p> DIV>
答
I don't think this is possible. Sessions live on the server (not strictly true I know, but for the purposes of this answer, it's true enough).
I would write a script (PHP or somesuch) that unsets the session variable and fire off an ajax call to it.
答
You would need to use an Ajax call to the server to access/delete the session variable as sessions are controlled/handled only on the server side, not the client side.