简体   繁体   English

在在线PHP会话中处理令牌

[英]dealing with Tokens in the session PHP online

I'm making use of storing random token values into session as well as flash message which prints out messages for one time only upon registration of updating profile,, this is working so far like it should on the localhost - wampserver. 我正在使用将随机令牌值存储到会话中以及仅在注册更新配置文件时一次打印出消息的Flash消息,到目前为止,它的工作方式与在localhost-wampserver上应该的一样。 However, after deploying the website to the live server the process works correctly as long as the user is not logged in, after I log in I just can't update the profile at all, also after a successful registration the message "you have been registered successfully" is shown every time I go to the the homepage while it should only appear once and only once.. and again on the local server it is working like charm. 但是,将网站部署到实时服务器后,只要用户未登录,该过程就可以正常工作。登录后,我根本无法更新配置文件,并且在成功注册后,也会显示“您已经每次访问首页都会显示“已成功注册”,而该页面应该只出现一次。.在本地服务器上,它再次像魅力一样工作。

So after checking some online resources the answer was it mostly the configuration of php.ini on the server is what causing the problem, so I checked the php.ini on the server and after comparing it to the local one i found these two line missing concerning the Session field: 因此,在检查了一些在线资源之后,答案便是造成服务器问题的主要原因是php.ini的配置,因此我检查了服务器上的php.ini,并将其与本地服务器进行比较之后,我发现这两行缺失关于“会话”字段:

session.save_path = "c:/wamp/tmp"
session.use_only_cookies = 1

Then I added them to the online version of php.ini and it still doesn't work, of course I've changed the save_path to some random value but the whole storing in session doesn't work at all until i comment the session.save_path line, the other line didn't change anything so I don't know where the problem is. 然后,我将它们添加到php.ini的在线版本中,但仍然无法正常工作,当然,我已将save_path更改为某个随机值,但是会话中的整个存储在我注释session.save_path之前根本无法工作session.save_path行,另一行没有任何更改,所以我不知道问题出在哪里。

Thanks in advance. 提前致谢。

you're trying to write to a directory php doesn't have write access to. 您正在尝试写入目录php没有写权限。 when you comment out the line, it stores it in the default php save path, which it does have write permissions. 当您注释掉该行时,它将其存储在默认的php保存路径中,该路径确实具有写权限。

I just found this PHP Based session variable not retaining value. 我刚刚发现此基于PHP的会话变量没有保留值。 Works on localhost, but not on server and it is exactly the cause of the problem, these people using register_globals ON .. that's it. 可以在localhost上运行,但不能在服务器上运行 ,这正是问题的原因,这些人使用register_globals ON ..就是这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM