本文介绍了PHPSESSID 每次请求都会更改而不是持久化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 iOS 应用程序向基于 PHP 的 Web 服务发送请求,过去一切正常,但最近我一直在丢失会话.

I have an iOS app sending requests to a PHP based web service , Everything used to work just fine but lately i've been losing sessions all the time.

我检查了 cookie 并注意到 PHPSESSID 在我发送的每个请求上都发生了变化,而不是使用相同的请求,

I've checked the cookies and noticed that PHPSESSID changes on EVERY request i send , instead of using the same one,

请求 #1 之后:我是一个 cookie !PHPSESSID = 9lsv80co96op3mg4tffpuoav22
请求 #2 之后:我是一个饼干!PHPSESSID = nn3f3v32j598jbhsof0admc442

After Request #1: I am a cookie ! PHPSESSID = 9lsv80co96op3mg4tffpuoav22
After Request #2: I am a cookie ! PHPSESSID = nn3f3v32j598jbhsof0admc442

我想知道是否有任何方法可以保留会话 ID,或者我只需要每次都保存并发布它?我宁愿将其作为服务器端解决方案,因为如果我必须在应用程序本身中更改某些内容,Apple 需要一周到十天的时间来批准它.

I wanted to know if there is any way to persist the session id, or i just have to save it and post it every time? I would rather make this a server-side solution since if i would have to chnage something in the app itself, it would take a week to ten days for Apple to approve it.

如果有任何配置可以帮助我保留 PHPSESSID 值,这对我非常有帮助.

If there's any configuration that would help me with retaining the PHPSESSID value It would be very helpful for me.

感谢您的帮助.谢谢!:)

Would appreciate your help. Thank you! :)

推荐答案

我相信您的应用程序没有保存 PHP 使用 PHPSESSID 发送的 cookie,因此它会为每个请求生成一个新的会话 ID.

I believe your application isn't holding the cookies that PHP is sending with the PHPSESSID so it's generating a new session id for each request.

这篇关于PHPSESSID 每次请求都会更改而不是持久化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 13:45