search
Homephp教程php手册php5与mysql5 web 开发技术详解-10 php会话管理php5与mysql5 web 开发技术详解-10 p

php5与mysql5 web 开发技术详解-10 php会话管理php5与mysql5 web 开发技术详解-10 p

Jun 13, 2016 am 10:55 AM
phpphp5webandsessiondevelopDevelopment TechnologyyesofmanageDetailed explanation

会话管理是web开发的一项重要内容,包括Session和Cookie两种技术。

1、Cookie工作原理

       setcookie()

2、Cookie应用开发

       只能读取所在域

       单一域不能超过20个Cookie,每个Cookie文件长度上限位4k字节,浏览器最多储存300个cookie

       6个属性:name , value ,expires ,path ,domain ,secure 

      

       保存表单内容

       控制访问授权

3、写个通用Cookie类

 

4、解决方案

  cookie存取优化

              可将一系列cookie数据保存到数组中

        检测客户端是否支持

              首次运行尝试设置一个cookie,然后调用

        二级域名实现

             setcookie( name , value ,expires ,path ,'domain.com‘,secure )

 

        cookie安全

  cookie限制

 

5、session概念

6、session配置

7、session应用

      创建

      修改

      查看当前sessionid

      改变过期时间 session.cookie_lifetime

      销毁当前session会话

8、session编码与解码

      session_encode()

      session_decode()

9、session中保存数组

10、session中保存对象

11、session存取优化

12、多服务器下共享session(重要)

13、session安全

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)