\LibCsrf

CSRF saldırılarına karşı korma sağlayan bir class Author(s): Selman TUNÇ www.selmantunc.com <selmantunc@gmail.com>

Summary

Methods
Properties
Constants
__construct()
getToken()
isTokenValid()
echoInputField()
verifyRequest()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
setToken()
readTokenFromStorage()
writeTokenToStorage()
$namespace
N/A

Properties

$namespace

$namespace : string

form daki crsf için kullanılacak inputun saklanacağı yer The namespace for the session variable and form inputs form daki crsf için kullanılacak inputun saklanacağı yer

Type

string

Methods

__construct()

__construct(string  $namespace = 'csrf') 

csrf koruması yapacak değer burada saklanır , başlngıçda hazırlama işlemleri yapılır

Initializes the session variable name, starts the session if not already so, and initializes the token

Parameters

string $namespace

getToken()

getToken() : string

koruma kodunu verir

Return the token from persistent storage

Returns

string

isTokenValid()

isTokenValid(string  $userToken) : boolean

session daki koruma kodu ile post edilen uyuşuyor mu bak Verify if supplied token matches the stored token

Parameters

string $userToken

Returns

boolean

echoInputField()

echoInputField() 

otomaitk olarak eklenmesi isteniyorsa bu kullanılır Echoes the HTML input field with the token, and namespace as the name of the field

verifyRequest()

verifyRequest() : boolean

crf yi doğrular Verifies whether the post token was set, else dies with error

Returns

boolean

setToken()

setToken() 

token oluştur rastgele bir kod eğer zaten varsa onu oku Generates a new token value and stores it in persisent storage, or else does nothing if one already exists in persisent storage

readTokenFromStorage()

readTokenFromStorage() : string

session daki leri okur Reads token from persistent sotrage

Returns

string

writeTokenToStorage()

writeTokenToStorage(  $token) 

/session a yazar Writes token to persistent storage

Parameters

$token