开发者

session with no cookies

开发者 https://www.devze.com 2023-04-07 18:52 出处:网络
I ran into a situation that I brought onto myself by disabling cookies: s开发者_运维知识库ession state wasn\'t working as expected. How do you check to see that the user has cookies enabled in an http

I ran into a situation that I brought onto myself by disabling cookies: s开发者_运维知识库ession state wasn't working as expected. How do you check to see that the user has cookies enabled in an http module?

Thanks.


Set a cookie and then redirect them to a page inside the same site. If you don't get a cookie back, then they don't have cookies enabled. You can track them through this adventure by embedding a code in the URL or submitting a form.

Assuming you've rigged the page to set a cookie already, you can also use JavaScript to retrieve a "did you send a cookie" page. Then you can look at what you got back to see if the browser returned the cookie you sent it.


If you have cookies disabled on your browser , then you can create a hidden field in your html page which will store your cookie value.

< input type='hidden' name='sessionid' > 

Retrieve this value when you move to next page .

0

精彩评论

暂无评论...
验证码 换一张
取 消