phpä¼è¯æ§å¶æ»ç»_php_web-itnose
é¦é¡µ
asp
php
javascript
iis
apache
html/css
coldfusion
ajax
vbscript
cgi
xml/xsl
è·¨æµè§å¨å¼å
ruby/rails
ç¨åºå
html5
jquery
seo
jboss
json
angularjs
markdown
nginx
thinkphp
yii
pageadmin
extjs
wampserver
kendo ui
coffeescript
gulp
ecmascript
bootstrap
itnoseé¦é¡µ > web > php >
phpä¼è¯æ§å¶æ»ç»
2017-06-06 03:39
ä¸.ä¼è¯è·è¸ªçæ¹å¼
1.使ç¨urlå°ç¨æ·çä¿¡æ¯ç¶æä¼ å°å¦ä¸é¢
2.使ç¨cookieå°ç¨æ·çä¿¡æ¯ç¶æï¼åæ¾å¨å®¢æ·ç«¯ç计ç®æºä¸
3.使ç¨sessionå°ç¨æ·çä¿¡æ¯ç¶æï¼åæ¾å¨æå¡ç«¯ç计ç®æºä¸
äº.设置cookie
bool setcookie(‘cookieçåå’,’cookieçå¼’,cookieçåæ´»æ¶é´ä¸è¬é»è®¤ä¸º0,
å½æµè§å¨å
³éå°±ä¼æ¶å¤±æè
time()*70设置ä»åæ´»çæ¶é´,’/’cookieçæ ¹ç®å½)
è¿æåäºå¯åå¯ä¸åçå¼
domain åå 设置cookieçææåå
secure ææcookieåªè½éè¿å®å
¨çhttpsä¼ é 设置为trueåªè½éè¿å®å
¨çhttps,é»è®¤æ¯false
ä¸.è·åcookie
使ç¨è¶
å
¨æ°ç»$_cookieå³å¯è·åcookie
ä¾ï¼è¾åºcookieä¸çææä¿¡æ¯
print_r($_cookie);
è¾åºcookieä¸å
¶ä¸ä¸æ¡ä¿¡æ¯
echo $_cookie[‘ä¿¡æ¯çåå’];
å.å é¤cookie
åªç¨æcookieçæ¶é´è®¾ç½®è¿æå°±è¡
setcookie(‘cookieå’,null,time()-1);
äº.设置session
1.é¦å
å
è¦å¯å¨session
session_start() å¼å¯session
å¨è¿ä¸ªå½æ°æ§è¡åä¸è½æä»»ä½çè¾åº
2.设置session
$_session[‘å称’]=’å¼’
3.è·åsession,éè¿ è¶
å
¨å±åéæ¥åå¼
$_session[‘å称’];
å
.éæ¯session
1.æ¸
é¤å
åä¸ç±sessionæ°ç»ä¿åçåé
unset($_session[‘å称’])
æ¸
é¤ææåéå¯ä»¥ä½¿ç¨$_session=array()
常ésession_name()å¯ä»¥æ¿å°session声æçåå
常ésession_id() å¯ä»¥æ¿å°session声æåååé¢çå¼
2.å é¤å®¢æ·ç«¯çcookieä¿ççsession_id
setcookie(session_name,null,time()-1);
3.å é¤æå¡ç«¯ä¿ççsessionä¿¡æ¯çæ件(ä¸è¬ä¸ä½¿ç¨ä»)
session_destroy()
ä¸.sessionçåå¾èªå¨åæ¶æºå¶
php.iniä¸ç¸å
³çé
ç½®
session.cookie_lifetime=0; å
³éæµè§å¨ç¸åºçsession失æ
session.gc_maxlifetime;设置è¿æsessionæ¶é´ï¼é»è®¤1440ç§
session.gc_probability/session.gc_pisor;å¯å¨åå¾åæ¶æºå¶çæ¦çï¼å»ºè®®å¼ä¸º1/1000ï½5000ï¼
å
«.session idçä¼ é
éè¿cookieä¼ ésession id
éè¿urlä¼ ésession id
1.windowsæå¡å¨ä¸éè¿urlä¼ é常ésid
2.linuxæå¡å¨ä¸ç¼è¾phpæ¶ï¼ å¦æ使ç¨äºâenable-trans-sidé
ç½®é项ï¼
åè¿è¡æ¶é项session.use_trans_sidé½è¢«æ¿æ´»
å¨å®¢æ·ç«¯ç¦ç¨cookieæ¶ï¼ ç¸å¯¹çurlå°è¢«èªå¨ä¿®æ¹ä¸ºå
å«sessionid.
ç¸å
³æç´¢ï¼
hibernate äºå¡æ§å¶
webserviceäºå¡æ§å¶
php jsp
php webservice
php å¾è¡¨
ç¸å ³æç«
2015-04-30 15:12 phpä¼è¯æ§å¶mysqlå¤æ
2015-07-25 09:57 phpä¼è¯æ§å¶(session&cookie)
2015-06-10 16:14 phpä¼è¯æ§å¶sessionä¸cookieä»ç»
2015-09-26 13:45 ãphpåmysql webå¼åã第23ç« å¨phpä¸ä½¿ç¨ä¼è¯æ§å¶ï¼éå°é¾é¢å¡å£³äºï½
2015-04-13 02:12 åºäºphp cookieä¼è¯ä¿æä¹iruleèæ¬
æ´å¤ç¸å ³æç« >>
ææ°æç«
2017-06-20 01:35 èé们ï¼æ没æå¯è½è®©phpæ件åæ¶åªè½ä¸ä¸ªäººè®¿é®
2017-06-20 01:35 æä¹ç¦æ¢å¾çç´æ¥éè¿url访é®
2017-06-20 01:35 æ±æ!å¯å¨wampåªè½ç¨æ¬æºè®¿é®,åå±åç½çå
¶å®è®¾å¤è®¿é®ä¸å°!æäºå¤§å天t-t
2017-06-19 15:35 nginxä¸çthinkphpé®é¢
2017-06-19 15:35 php form æ件ä¸ä¼
æ´å¤ææ°æç« >>
çé¨æç´¢
php xml
delphi for php
delphi php
php sqlserver
javaåºç¡æ»ç»
javaåºç¡è¯æ³æ»ç»
cè¯è¨æ»ç»
c++å¦ä¹ æ»ç»
db2æ§å¶ä¸å¿
db2æ§å¶å°
javaåºç¡ç¥è¯æ»ç»
javaç¨åºåæ»ç»
phpå.net
javaweb php
php asp.net
京icpå¤14022385å·-2
©2014 itnose软件ç¼ç¨æç¨ | èç³»æ们ï¼emailï¼twobrushes@126.com qq:35155868