Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to destroy the session value which is saved and then set new value to the session variable.

if anyone have the answer please help me
Posted
Comments
Thanks7872 4-Sep-13 4:44am    
Tag the question properly.And one more thing,Why through javascript only?

1 solution

Quite simply no.

Javascript, a engine which runs in the client browser sandbox, does not have access to the server hosted session object. Nor should it. Just think about the security implications?

My advice would be to use AJAX. Write JS to make an AJAX call to purposely designed page for modifying the session.

But I'd still be concerned about this too as if I found it whilst interrogating your page using my browsers developer tools, I could quite easily abuse it and make modifications to my session on your server.

Depending on what your site does, say a shop? I could hack it and order myself lots of free products!

When thinking about website security you should take a look at OWASP and PCIDSS.

https://www.owasp.org[^]
https://www.pcisecuritystandards.org/security_standards/index.php[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900