CHttpRequest

Namerequest
ClassCHttpRequest
Location/home/vhosts/app-manager.eu5.org/framework/web/CHttpRequest.php
CHttpRequest encapsulates the $_SERVER variable and resolves its inconsistency among different Web servers.

CHttpRequest also manages the cookies sent from and sent to the user. By setting {@link enableCookieValidation} to true, cookies sent from the user will be validated to see if they are tampered. The property {@link getCookies cookies} returns the collection of cookies. For more details, see {@link CCookieCollection}. CHttpRequest is a default application component loaded by {@link CWebApplication}. It can be accessed via {@link CWebApplication::getRequest()}.

Options

Displaying 1-10 of 10 results.
NameValueDescriptionType
enableCookieValidationfalseWhether cookies should be validated to ensure they are not tampered. Defaults to false.boolean
enableCsrfValidationfalseWhether to enable CSRF (Cross-Site Request Forgery) validation. Defaults to false. By setting this property to true, forms submitted to an Yii Web application must be originated from the same application. If not, a 400 HTTP exception will be raised. Note, this feature requires that the user client accepts cookie. You also need to use {@link CHtml::form} or {@link CHtml::statefulForm} to generate the needed HTML forms in your pages. @see http://seclab.stanford.edu/websec/csrf/csrf.pdfboolean
csrfTokenName'YII_CSRF_TOKEN'The name of the token used to prevent CSRF. Defaults to 'YII_CSRF_TOKEN'. This property is effectively only when {@link enableCsrfValidation} is true.string
csrfCookienullThe property values (in name-value pairs) used to initialize the CSRF cookie. Any property of {@link CHttpCookie} may be initialized. This property is effective only when {@link enableCsrfValidation} is true.array
behaviorsarray()The behaviors that should be attached to this component. The behaviors will be attached to the component when {@link init} is called. Please refer to {@link CModel::behaviors} on how to specify the value of this property.array
hostInfonullSets the schema and host part of the application URL. This setter is provided in case the schema and hostname cannot be determined on certain Web servers. the schema and host part of the application URL.string
baseUrlnullSets the relative URL for the application. By default the URL is determined based on the entry script URL. This setter is provided in case you want to change this behavior. the relative URL for the applicationstring
scriptUrlnullSets the relative URL for the application entry script. This setter is provided in case the entry script URL cannot be determined on certain Web servers. the relative URL for the application entry script.string
portnullSets the port to use for insecure requests. This setter is provided in case a custom port is necessary for certain server configurations. port number. @since 1.1.3integer
securePortnullSets the port to use for secure requests. This setter is provided in case a custom port is necessary for certain server configurations. port number. @since 1.1.3integer
Free Web Hosting