Solution to session error in DWR pop-up

Source: Internet
Author: User
Tags csrf attack

I started learning DWR today and encountered some problems. I always jumped out of session error.
Problem description:
The session error dialog box is displayed on the front-end page.
The console outputs:
11:58:53 org. directwebremoting. util. commonsloggingoutput Error
Severe: A request has been denied as a potential csrf attack.
Error message.

 

The request is rejected because of possible cross-site request forgeries (Cross-Site Request Forgery) attacks.
That is to say, the page url may be called by a cross-site service.
For example, an image on your own page may be referenced by other sites directly through [img]... [/img.

Solution:
In the Web. xml configuration file ..
DWR Configuration


DWR-invoker
Org. directwebremoting. servlet. dwrservlet

debug
true


crossdomainsessionsecurity
false

Added the corssdomainsessionsecurity configuration option. This parameter is available only in DWR version 2.0. The default value is true, that is

Prohibit other domains from sending requests.
Corssdomainsessionsecurity: if it is set to false, requests can be made from other domains. Note that this may cause some security risks.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.