Skip to content

Commit

Permalink
📚 Adding DOCUMENTATION
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Sarfaraz authored Oct 24, 2020
1 parent 3f9b960 commit 3ebf0ff
Showing 1 changed file with 86 additions and 2 deletions.
88 changes: 86 additions & 2 deletions docs/DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
## Notice
## Getting Started

Generate CSRF token

```php

require('vendor/autoload.php');
use AvatarPHP\Glide;

$csrf=new Glide();

echo $csrf->token();

```

In html file


```html

<input type="hidden" name="csrf_token" value="<?php echo $csrf->token(); ?>
">

```


Verify the token

```php

require('vendor/autoload.php');
use AvatarPHP\Glide;

$csrf=new Glide();

$token=$_POST['csrf_token'];


if(Glide::validate($key)){
//next phase
};

```
Destroy CSRF token
##### destroy ()
```php
$csrf->destroy();
```

Get session id
##### id ()
```php
$csrf->id();
```
Regenerate session id

##### Regenerate ()

```php
$csrf->regenerate();
```

Put session value

##### put ()

```php
$csrf->put($key,$value);
```
Get session value

##### get ()

```php
$csrf->get($key);
```
##### token ()
Get token value
```php
use Glide\Token\Engine;

$token = Engine::token();
```




Working on documentation

0 comments on commit 3ebf0ff

Please sign in to comment.