473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

_COOKIE[] unique?

I may be getting confused over nothing here but ...

I was wondering if the _COOKIE global is unqiue to each visitor or is
it global across all visitor sessions? If it is truly global on the
server side, is it possible that a cookie from one user's session may
corrupt another user's session? How would I know which cookie goes
with which user session/browser?

Dec 30 '05 #1
4 1950
ne**********@yahoo.com wrote:
I may be getting confused over nothing here but ...

I was wondering if the _COOKIE global is unqiue to each visitor or is
it global across all visitor sessions? If it is truly global on the
server side, is it possible that a cookie from one user's session may
corrupt another user's session? How would I know which cookie goes
with which user session/browser?


$_COOKIE will only have cookies for current visitor, I believe they are
sent over via http request :) Global in this context means that $_COOKIE
is accessible from anywhere in the script, not that it has the cookies
of all user sessions.
luph
Dec 30 '05 #2
ne**********@yahoo.com wrote:
I was wondering if the _COOKIE global is unqiue to each visitor or is
it global across all visitor sessions? If it is truly global on the
server side, is it possible that a cookie from one user's session may
corrupt another user's session? How would I know which cookie goes
with which user session/browser?


The _COOKIE variable is only global in the sence of being available in every
namespace without an explicit import (e.g. with the global keyword).

Each cookie created for a user is unique to that user because it's written
to his or her system. The browser adds a Cookie header to the request when
it finds a match on the local file system for a specific page.

When you create a cookie containing a user or session ID for user A, this
user's browser will send the ID back to the server when the appropriate page
is requested. Of course, when another user has access to user A's system and
browser, he or she will be recognized as user A while he or she isn't.
HTH;
JW
Dec 30 '05 #3
ne**********@yahoo.com wrote:
I may be getting confused over nothing here but ...

I was wondering if the _COOKIE global is unqiue to each visitor or is
it global across all visitor sessions? If it is truly global on the
server side, is it possible that a cookie from one user's session may
corrupt another user's session? How would I know which cookie goes
with which user session/browser?


$_COOKIE is unique to the user's browser session. The cookie is stored
on the user's system.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Dec 30 '05 #4
Thanks to all for the clarification! It all makes a lot of sense now.

Dec 30 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kevin parks | last post by:
hi. I've been banging my head against this one a while and have asked around, and i am throwing this one out there in the hopes that some one can shed some light on what has turned out to be a...
26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
5
by: Kamil | last post by:
Hello What should I use for better perfomance since unique constraint always use index ? Thanks Kamil
4
by: bwmiller16 | last post by:
Guys - I'm doing a database consistency check for a client and I find that they're building unique indexes for performance/query reasons where they could be using non-unique indexes. Note...
5
by: aj | last post by:
DB2 WSE 8.1 FP5 Red Hat AS 2.1 What is the difference between adding a unique constraint like: ALTER TABLE <SCHEMA>.<TABLE> ADD CONSTRAINT CC1131378283225 UNIQUE ( <COL1>) ; and adding a...
10
by: Laurence | last post by:
Hi there, How to differentiate between unique constraint and unique index? These are very similar but I cannot differentiate them? Could someone give me a hand? Thanks in advance
4
luke14free
by: luke14free | last post by:
Hello, I think to have some problem because that code, that is done in order to decide if the page has to have inside the login form (-->user not yet logged) or not(-->user logged). <?php...
8
by: anndr0id | last post by:
Hey Guys - Ever see anything like this? I've set a cookie successfully (it is showing up correctly in my cookies) but when I try to reference the cookie via $_COOKIE, it is returning an undefined,...
5
by: Pseudonyme | last post by:
Dear All : Ever had an httpd error_log bigger than the httpd access log ? We are using Linux-Apache-Fedora-Httpd 2006 configuration. The PHP lines code that lead too tons of errors are : ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.