As others have said, an auth ticket MUST be httponly.
The best way to do this is to use ApplicationServices. The JSON authentication endpoint provides IsLoggedIn, and I noticed your concern about server loading. The overhead of invoking a static endpoint that just checks the cookie for you is negligible. In fact.
So, if you use MsAjax, just enable application services and call Sys.Services.AuthenticationService.IsLoggedIn.
If you want to do this from raw javascript, this is codez; -)
Add this segment to the configuration file
<system.web> ------------ </system.web> <system.web.extensions> <scripting> <webServices> <authenticationService enabled ="true" requireSSL="false"/> </webServices> </scripting> </system.web.extensions>
Page....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript"> function createXHR() { </script> </head> <body> <input type="button" value="IsLoggedIn?" onclick="isLoggedIn()" /> </body> </html>
source share