快速业务通道

PHP教程:COOKIE与SESSION联合实现跨域

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-03-16
n_commit — Alias of session_write_close
  • session_decode — Decodes session data from a string
  • session_destroy — Destroys all data registered to a session
  • session_encode — Encodes the current session data as a string
  • session_get_cookie_params — Get the session cookie parameters
  • session_id — Get and/or set the current session id
  • session_is_registered — Find out whether a global variable is registered in a session
  • session_module_name — Get and/or set the current session module
  • session_name — Get and/or set the current session name
  • session_regenerate_id — Update the current session id with a newly generated one
  • session_register — Register one or more global variables with the current session
  • session_save_path — Get and/or set the current session save path
  • session_set_cookie_params — Set the session cookie parameters
  • session_set_save_handler — Sets user-level session storage functions
  • session_start — Initialize session data
  • session_unregister — Unregister a global variable from the current session
  • session_unset — Free all session variables
  • session_write_close — Write session data and end session
  • 哈哈,不是我懒噢,这里只讲跨域.
    OK,大概温习了下COOKIE和SESSION,开始实现我们的跨域.
    首先我描述下我的思路,COOKIE可以指定域名,也就是说它可以跨域子域,例如:setcookie(’name’,''joshua’,time()+3600*24,’/'',’wemvc.com’),那么A.wemvc.com,B.wemvc.com都可以访问到 PHP教程:COOKIE与SESSION联合实现跨域 - 凌众科技
    快速业务通道

    PHP教程:COOKIE与SESSION联合实现跨域

    作者 佚名技术 来源 NET编程 浏览 发布时间 2012-03-16
    content

    凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

    分享到: 更多

    Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

    地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

    电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

    《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号

    COOKIE[''name''],值也均为’joshua’.同理,SESSION ID也可以设置成这个域名,那么A.wemvc.com和B.wemvc.com都可以得到同一个SESSION ID,那么我们的目的也就达到了.因为知道了同一个SESSION ID就可以访问到这个SESSION中的值了.SESSION有多种方式存储,文件\数据库\内存等,我们采用数据库存储,因为如果A.wemvc.com,B.wemvc.com不在同一台服务器上,那么内存和文件的存储方式就很难实现跨域了,至于到底又没有方法,本人还没有试过.
    首先在数据

    凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

    分享到: 更多

    Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

    地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

    电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

    《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号