You are here

public function ServicesClientConnectionSessionAuth::prepareRequest in Services Client 7.2

Same name and namespace in other branches
  1. 7 services_client_connection/plugins/ServicesClientConnectionSessionAuth.inc \ServicesClientConnectionSessionAuth::prepareRequest()

Implements prepareRequest().

Parameters

ServicesClientConnectionHttpRequest $request:

Overrides ServicesClientConnectionPlugin::prepareRequest

File

services_client_connection/plugins/ServicesClientConnectionSessionAuth.inc, line 106
Session authentication for 3.x version

Class

ServicesClientConnectionSessionAuth
@file Session authentication for 3.x version

Code

public function prepareRequest(ServicesClientConnectionHttpRequest &$request) {
  parent::prepareRequest($request);
  if ($this->sessid) {
    $request->cookie[] = $this->session_name . '=' . $this->sessid;
  }
  if ($this->csrf_token) {
    $request->http_headers['X-CSRF-Token'] = $this->csrf_token;
  }
}