Skip to content

Commit

Permalink
setcookie
Browse files Browse the repository at this point in the history
  • Loading branch information
xtgxiso committed Feb 15, 2017
1 parent cc33aa3 commit 7fdc4d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions App.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class App extends Worker
*
* @var string
*/
const VERSION = '0.2.3';
const VERSION = '0.2.4';

private $conn = false;
private $map = array();
Expand Down Expand Up @@ -183,7 +183,11 @@ public function ServerHtml($data){
public function Header($str){
Http::header($str);
}


public function setcookie($name,$value = '',$maxage = 0,$path = '',$domain = '',$secure = false,$HTTPOnly = false){
Http::setcookie($name,$value,$maxage,$path,$domain,$secure,$HTTPOnly);
}

public function run()
{
autoload_dir($this->autoload);
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ $app->HandleFunc("/json",function() {
$app->HandleFunc("/",function() {
//自定义响应头
$this->Header("server: xtgxiso");
//设置cookie
$this->setcookie("xtgxiso",time());
//以json格式响应
$this->ServerJson(array("name"=>"WebWorker"));
});
Expand Down

0 comments on commit 7fdc4d2

Please sign in to comment.