了解会话/ Cookie [英] Understanding Sessions/Cookies

查看:74
本文介绍了了解会话/ Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,


好​​的。在这里,我再次得到一些答案。我从这里开始比其他地方了解更多的东西。我希望我不会被宠坏。 LOLZ ......


关联数组是一个数组,它使用名称或字符串作为存储数据的空白(而不是通常的0,1,2 ..数字)。我对吗?所以,在$ _SESSION中,我可以在一个用户会话中存储$ _SESSION [''views''],$ _SESSION [''timeLog''],或者我想要的任意数量(离散),对吧?而且,我可以在一个服务器一个会话中在网站的不同页面中调用它,对吧?这一切都在离开现场时被摧毁了,对吗?


$ _COOKIES也是如此,除了......那就是我不知道的......例外。这两者有很多共同之处,现在我不知道真正的区别是什么。我的意思是,我知道cookie是在客户端的PC上设置的,而会话是在会话期间用于服务器的。但是,除了这两个之外还有更多吗?我是否还可以在会话期间创建不同的cookie值并在不破坏存储在客户端PC中的真实cookie的情况下销毁它们而不会过期?同时使用两者是要走的路,是不是真的?


这些以及更多的东西让我对cookie和会话感到困惑。任何输入都将有助于绘制两者之间的界限。请随意为我批评,喊叫或爆炸任何信息。我很感激。不要误会我的意思,我喜欢饼干比会话更好。他们很好吃。会议,这取决于它是一个锅会话,友好的会议,或其他什么...... LOLZ ...哦,我已经阅读了Tizag,w3s,php.net等的那些教程......我只需要从其他人那里了解他们如何理解它们以便更好地理解它。


什么时候以及在哪里使用哪个?

$ b $我道歉。很明显,对于像我这样的初学者来说,知道两者似乎更令人困惑。


@Markus(和其他版主)


请分享你的智慧我和其他初学者在那里。


谢谢


rsbgm

Dear All,

Ok. Here I am again for some answers. I''ve gotten to understand more of things from here than other places. I hope I don''t get spoiled. LOLZ...

Associative Array is an array that uses names or strings as indeces of the data stored (instead of the usual 0,1,2.. numbers). Am I right? So, in $_SESSION, I can store $_SESSION[''views''], $_SESSION[''timeLog''], or whatever I want as many as I can (discretely) in one user session, right? And, I can call it all in the different pages of the site in one server one session, right? And it all get''s destroyed upon leaving the site, right?

It goes the same for $_COOKIES except that... that''s what I don''t know... the exceptions. The two has so many in common now I don''t know what the true difference is. I mean, I know that cookies are set on the client''s PC, while session is for server''s use during the session. But, is there more to it than just those two? Can I also create different cookie values during the session and destroy those without destroying the real cookie stored in the client''s PC while it hasn''t expired? Using both at the same time is the way to go, is it really?

These and many more are things that confuses me with both cookies and sessions. Any input will really help in drawing the line between the two. Please feel free to criticize, holler, or blast any info for me. I''d appreciate it. Don''t get me wrong, I like cookies better than session. They''re delicious. Session, it depends whether it''s a pot session, friendly make out session, or whatever... LOLZ... Oh, and I''ve read those tutorials at Tizag, w3s, php.net, etc... I just need to here it from other folks how they understand both to better understand it myself.

When else and where else to use which?

My apologies. Aparently, for beginners like me, knowing both seem more confusing.

@Markus (and the other moderators)

Please share your wisdom for me and other beginners out there.

Thanks

rsbgm

推荐答案

_SESSION,我可以存储
_SESSION, I can store


_SESSION [''views''],
_SESSION[''views''],


_SESSION [''timeLog''],或者我想要的任何东西我可以(离散地)在一个用户会话中使用,对吧?而且,我可以在一个服务器一个会话中在网站的不同页面中调用它,对吧?这一切都在离开网站时被摧毁了,对吗?


_SESSION[''timeLog''], or whatever I want as many as I can (discretely) in one user session, right? And, I can call it all in the different pages of the site in one server one session, right? And it all get''s destroyed upon leaving the site, right?

It goes the same for

这篇关于了解会话/ Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆