| Author |
How to detect and redirect to cookie disabled page?
|
|
| TechMate 2005-03-10, 5:54 pm |
| I am trying to check if the client browser has cookies ENABLED or not and if
not to redirect to a NoCookie.aspx page. This check needs to be ensured for
Login and Basket pages. How do I accomplish this in Commerce Server 2002
sites. I tried setting the CS Authentication - No Cookie form property (full
path to NoCookie page) but did not work. Is there any in-built
CommerceApplication methods to check this?? If not how can I achieve this??
I have tried setting a temporary cookie on session start and to check if the
cookie exists before login or basket, but the check function always returns
true.
private void CheckBrowserCookies()
{
if (Request.Cookies["CheckBrowser"] != null )
return;
else
Response.Redirect("NoCookiesError.aspx", false);
}
Any Help is greatly appreciated.
| |
|
| Hi
try this JavaScript to check if the client browser support cookies
function checkBrowser(){
if( navigator.cookieEnabled == false ){
top.location.href = "NoCookiesError.aspx
return false;
}
return true;
}
arik
"TechMate" wrote:
> I am trying to check if the client browser has cookies ENABLED or not and if
> not to redirect to a NoCookie.aspx page. This check needs to be ensured for
> Login and Basket pages. How do I accomplish this in Commerce Server 2002
> sites. I tried setting the CS Authentication - No Cookie form property (full
> path to NoCookie page) but did not work. Is there any in-built
> CommerceApplication methods to check this?? If not how can I achieve this??
>
> I have tried setting a temporary cookie on session start and to check if the
> cookie exists before login or basket, but the check function always returns
> true.
>
> private void CheckBrowserCookies()
> {
> if (Request.Cookies["CheckBrowser"] != null )
> return;
> else
> Response.Redirect("NoCookiesError.aspx", false);
> }
>
> Any Help is greatly appreciated.
| |
| TechMate 2005-03-15, 5:53 pm |
| Thanks Arik
"arik" wrote:
[vbcol=seagreen]
> Hi
>
> try this JavaScript to check if the client browser support cookies
> function checkBrowser(){
>
> if( navigator.cookieEnabled == false ){
>
> top.location.href = "NoCookiesError.aspx
> return false;
>
> }
> return true;
> }
>
> arik
>
> "TechMate" wrote:
>
|
|
|
|