会话,Cookies或两者兼而有之?

编程入门 行业动态 更新时间:2024-10-25 06:31:18
本文介绍了会话,Cookies或两者兼而有之?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我差不多完成了一个脚本,目前所有用户都在使用预设用户并通过。目前我正在使用会话,但我希望访客能够在不使用用户的情况下访问该网站并传递一般公共页面。 最佳推荐是什么? 该软件适用于露营地和B和B预订。

I am almost finished with a script and currently all users are using a preset user and pass. Currently I am using sessions but I want guests to be able to come to the site without using a user and pass for the general public pages. What is the best recommendation? The software is for campground and B and B reservations.

推荐答案

我差不多完成了一个脚本,目前所有用户都在使用预设用户并通过。目前我正在使用会话,但我希望访客能够在不使用用户的情况下访问该网站并传递一般公共页面。 什么是最佳推荐? 该软件适用于露营地和B和B预订。 I am almost finished with a script and currently all users are using a preset user and pass. Currently I am using sessions but I want guests to be able to come to the site without using a user and pass for the general public pages. What is the best recommendation? The software is for campground and B and B reservations.

为自己省去一些麻烦并构建一个每个页面都继承的抽象类。将安全性构建为抽象,每个页面自动检查安全性,除非继承类重写。这样可以避免让您不小心让人们​​进入页面,因为您忘记申请安全性。

Save yourself some hassle and build an abstract class that every page inherits. Build your security into the abstract that way every page automatically checks security UNLESS the inheriting class overrides. This will save you from accidentally letting people get into pages here and there because you forgot to apply to the security.

Cookies - 存储在您的系统中。 session - 一旦关闭浏览器会话值过期就将值设为全局 Cookies - stored in your system permenently . session - stord the value global once close the browser session value expired

我同意b1randon:最好这样做更多结构化的方式,然后只是在饼干和会话变量之间跳跃。 b1randon :你能否建议一个解决方案的方法? Ronald:很酷: I agree with b1randon: it is better to do this in a more structured way then just ''hopping'' between cookies and session variables. b1randon: can you also suggest an approach towards a solution? Ronald :cool:

更多推荐

会话,Cookies或两者兼而有之?

本文发布于:2023-10-21 17:20:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1514854.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:兼而有之   Cookies

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!