Detect if cookies are enabled

S

Slipperman

if(!IsPostBack)
{
if(Request.Browser.Cookies)
{
objUserCookie = Request.Cookies["userInfo"];
 
D

Dan

Request.Browser.Cookies determines if the browser supports cookies, not if
they're enabled.

Not sure of a neat way to check they're enabled - maybe try creating one,
and then retrieve its value.

Dan

Slipperman said:
if(!IsPostBack)
{
if(Request.Browser.Cookies)
{
objUserCookie = Request.Cookies["userInfo"];


NWx said:
Hi,

How can I detect is cookies are enabled or not in client browser?

Thanks?
 
G

gh0st54

There is no way to verify that cookies are not disable other than
creating a cookie a retrieving it.

Dan said:
Request.Browser.Cookies determines if the browser supports cookies, not if
they're enabled.

Not sure of a neat way to check they're enabled - maybe try creating one,
and then retrieve its value.

Dan

Slipperman said:
if(!IsPostBack)
{
if(Request.Browser.Cookies)
{
objUserCookie = Request.Cookies["userInfo"];


NWx said:
Hi,

How can I detect is cookies are enabled or not in client browser?

Thanks?
 
E

Eric Lawrence [MSFT]

Also, please note that Session cookies may be enabled while Permanent
cookies may not.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

gh0st54 said:
There is no way to verify that cookies are not disable other than
creating a cookie a retrieving it.

"Dan" <[email protected]> wrote in message
Request.Browser.Cookies determines if the browser supports cookies, not if
they're enabled.

Not sure of a neat way to check they're enabled - maybe try creating one,
and then retrieve its value.

Dan

Slipperman said:
if(!IsPostBack)
{
if(Request.Browser.Cookies)
{
objUserCookie = Request.Cookies["userInfo"];


Hi,

How can I detect is cookies are enabled or not in client browser?

Thanks?
 
E

Eric Lawrence [MSFT]

The way this is done on Microsoft Office Online is that we have a page which
tries to set a session cookie and a permanent cookie; this page then
redirects to a page which tests for those cookies. If they're not both
present, that page then redirects to a "you need to enable cookies" error
page.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top