Link to home
Start Free TrialLog in
Avatar of Moti Mashiah
Moti MashiahFlag for Canada

asked on

asp.net & javascript

Hi Guys,
I have a aspx page which contain element that call javascript function:

Here is the example:
 <asp:Button ID="btnClose" runat="server" CssClass="btn btn-default" Text="Close" OnClientClick="javascript:delCookie('hdnMenuIds');delCookie('hdnMenuIdsOld');" visible="false"/>

//javascript function
  function delCookie(name) {          
                document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
            };

Open in new window

The problem I have with this concept is xss/ cross site vulnerability.
I would like to know if you have any idea to secure this function?

N.B - this function been called by many button in the app so please try giving me solution for the javascript function itself.

Thank you in advance.
ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Moti Mashiah

ASKER

Thanks