易截截图软件、单文件、免安装、纯绿色、仅160KB

httpOnly cookie flag support in PHP 5.2

http://ilia.ws/archives/121-httpOnly-cookie-flag-support-in-PHP-5.2.html
Thanks to a patch from Scott
MacVicar that I've just applied to CVS, PHP 5.2 will have support for
httpOnly cookie flag. This neat little feature allows you to mark a
newly created cookie as HTTP only, another words inaccessible to
browser based scripting languages such as JavaScript. This means it
would become far more difficult, if not impossible to steal a user's
cookie based session by injecting JavaScript into a page and then using
to read cookies.
This flag can be toggled by passing TRUE as the 7th parameter to the
setcookie() and the setrawcookie() functions respectively. Ex:
PHP:
<?
php
setcookie
(
"abc"

"test"

NULL

NULL

NULL

NULL

TRUE
); 
setrawcookie
(
"abc"

"test"

NULL

NULL

NULL

NULL

TRUE
); 
?>
The support of the httpOnly flag extends to the session extension as
well, where it can be enabled by setting the session.cookie_httponly
INI setting to 1. Or passing TRUE as the 5th parameter to the
session_set_cookie_params() function.
PHP:
<?
php
ini_set
(
"session.cookie_httponly"

1
);
// or
session_set_cookie_params
(
0

NULL

NULL

NULL

TRUE
);
?>
Unfortunately, at this time according to my tests no other browser has
adopted this rather handy feature, but with the continual increase of
XSS attacks, I am sure they'll adopt this concept soon.
For people using PHP 4 and PHP 5.1 you can add this flag yourself by
sending cookies manually via the header function and prefixing the
;httpOnly flag to the cookie as shown in the example below:
PHP:
<?
php
header
(
"Set-Cookie: hidden=value; httpOnly"
);
?>



相关文档:

asp、php、asp.net、jsp介绍及优缺点比较


现在主流的网站开发语言无外乎asp、php、asp.net、jsp等。
网页从开始简单的hmtl到复杂的服务语言,走过了10多个年头,各种技术层出不穷,单个的主流技术也在不断翻新的版本,现在分析下各种语言的区别、优势、劣势、开发注意事项!
HTML:当然这是网页最基本的语言,每一个服务器语言都需要它的支持,要学习,这个肯定是开 ......

php 目录和文件操作

<?php
//新建目录
mkdir("/path/to/my/dir", 0700); //0700表示权限最大
//删除目录
rmdir("/path/to/my/dir");
//遍历目录
$p =dir(/etc/php5);
echo "handler:".$p->handler;
while(false!=$entry=$p->read()){
    echo $entry."\n" ;
}
$p->close();
//输出文件内容
$handle=@ ......

linux 64bit _ php 添加 tidy 支持 _ 笔记

# 安装tidy
yum install tidy libtidy-devel
# 给php添加tidy模块
wget http://pecl.php.net/get/tidy-1.2.tgz
tar -xvzf tidy-1.2.tgz
cd tidy-1.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --libdir=/usr/lib64
make
make install
echo "extension="tidy.so"" ......

独家:Zend和RightScale联手将PHP应用到云计算


2009-10-22 09:16
 | 
322次阅读
 | 
【已有0
条评论】发表评论
关键词:PHP

 | 感谢yvonne_826
的提供
 | 
收藏这篇新闻
日前,PHP语言及工具供应商Zend
Technologies宣布将联手云计算应用管理领军企业RightScale,帮助PHP开发者进入云计算的应用。RightScale将 ......

重新审视 PHP 框架 CodeIgniter VS Zend

作者:Ekerete
翻译:Emeric Li (http://lee.kometo.com/index.php/archives/117
)
原文:http://www.avnetlabs.com/php/php ... r-vs-zend-framework
我们计划从头开始一个新项目,为此评估了一些PHP框架。我们的备选列表有CakePHP , CodeIgniter , Symfony和Zend 。 我们分别使用这4种框架编写了一个相同的小应用( ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号