duanpu1064 2018-10-22 10:51
浏览 45

PHP Session和Cookies无法在本地MAMP环境中运行

I’m trying to set up a local MAMP PHP development environment to develop a PHP web application for deployment on an Apache web server. The web app spans several subdomains, with one subdomain, “portal.” handling user accounts, logins, etc.

The user portal uses PHP Session variables, as well as cookies, to mark a user as logged in, and several of the subsequent methods rely on the user’s logged in status (checked using the session variable and cookies).

The problem is that the cookies and Session variables set on the Portal subdomain don’t seem to be shared across the whole site. Everything works fine on the web server, but on my MAMP environment the cookies and Session variables appear unset outside of the subdomain where they are initially set. This is not the case on the web server, where the cookies and Session variables appear to be shared across the entire site.

I’ve tried this using both localhost and a local development domain (e.g. “portal.domain.test”) set up through my hosts file. I’m using Apache vhosts for subdomains the same as I am on the web server.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 flink cdc无法实时同步mysql数据
    • ¥100 有人会搭建GPT-J-6B框架吗?有偿
    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名