Forum

Yampiz Forum

Sharing let knowledge Spreaded, Reading let spirits growth, Creative let culture extended, Let us
  • 禁止廣告文
  • 知識傳播
  • 閱讀
  • 心靈成長
  • 創作
  • 文化傳承
Forum Dictionary / Programming / 網頁/網站程式 / PHP /

PHP 子網域共用 Session

New Subject
Random
Previous
Next
|
PHP 子網域共用 Session

有時侯我們的網站設計上可能採用子網域的方式來提供不同類型的資訊.

例如:

shopping.mydomain.com 及 cart.mydomain.com

當我們想要利用 SESSION 要在兩個網站之間互通資訊時, 我們就可以利用 子網域共用 Session 的方式來實現唷. 只要在 session_start(); 之前加入這個指令:

ini_set("session.cookie_domain", ".mydomain.com.tw");

或者是

session_set_cookie_params(0,'/','.mydomain.com.tw',0);

測試時記得要先重開瀏灠器才會生效~

  • Keywords : mydomain, 資訊, 網站設計上, 網站, 測試, 採用子網域, 指令, 想要利用, 就可以利用, 子網域共用, 只要, 前加入這, 例如, 互通資訊, shopping, session_start, session, ini_set, cookie_domain, Session
0 0
2010-09-28T19:05:00+0000


  • Now, you can post comments by Facebook Account when your Yampiz account was logout or unvariable. whatever, we suggest to post comment by Yampiz Account to get more bounds to join new events of Heyxu
Comment
 
Verify

Facebook Page

QR-Code and APP Launcher

User Guide
This Webpage

In those service tabs, "Scan QRCode, in mobile device" or "Click the button, in this device" to open webpage or APP-related operations.
QRCode
  • Auto Platform
    For better browsing experience, it will auto detects your device to display webpage.
  • Bug Report
    Tell us about the idea, problem and errors you found.
  • Comodo Secure
    The sensitive data transmission adopts by SSL-2048 authenticated encryption.
  • Copyright
    © 2009 YamPiz Digital Inc. & Jaby Group. All rights reserved.
  • Revised Version
    V2.2.061
    03 Aug 2023 (GMT+8)