Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am developing the asp.net using Vb.net code. I need to notify my client if client's browser is disabled the cookies, when the launch the asp.page.

Pls help me.

Maideen
Posted

1 solution

It is explained here: http://stackoverflow.com/questions/4603289/how-to-detect-that-javascript-and-or-cookies-are-disabled[^].

Note that JavaScipt can be also disabled. Then — no luck; however, you can at least notify the use about it, and this is also explained in the above referenced answer.

Now, if you also want to notify the server side that cookies are enabled or not, you can send an HTTP request to the server side by JavaScript using Ajax:
http://en.wikipedia.org/wiki/Ajax_%28programming%29[^].

—SA
 
Share this answer
 
Comments
Maideen Abdul Kader 17-Oct-13 5:41am    
Hi Below code work fine. thank all of you to support me

function CookieSetText()
{
var cookieEnabled=(navigator.cookieEnabled)? true : false
//if not IE4+ nor NS6+
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
{
document.cookie="testcookie"
cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false
}
if (cookieEnabled)
{
document.write("Cookies are enabled");
}
else
{
document.write("Cookies are not enabled");
}
}
window.onload = function () {
//calling the function on page load
CookieSetText();
};

maideen
Sergey Alexandrovich Kryukov 17-Oct-13 10:53am    
You are very welcome.
Good luck, call again.
—SA

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