473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Get values for ALL cookies?

I'm trying to track who's logged into a site (without setting flags in
the databses).

At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):

Fred
Doris
Bert
etc.

TIA,

Adam.
Sep 12 '05 #1
7 2624
Adam wrote:
I'm trying to track who's logged into a site (without setting flags in
the databses). In php script you have cookies for only current user so you can't do
it without database (SQL or text - doesn't matter)
At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):

Fred
Doris
Bert
etc.


1. Use session for logging users
2. Make database-driven session handler
3. Now you can get list of users by regular SQL query.

You can also parse session files in /tmp directory instead of making
database-driven handler but I don't think it's good way.
Sep 12 '05 #2
On Mon, 12 Sep 2005 10:08:29 +0300, Alexey Kulentsov wrote:
Adam wrote:
I'm trying to track who's logged into a site (without setting flags in
the databses). In php script you have cookies for only current user so you can't do
it without database (SQL or text - doesn't matter)
At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):

Fred
Doris
Bert
etc.


1. Use session for logging users
2. Make database-driven session handler
3. Now you can get list of users by regular SQL query.


I was trying to avoiid touching the current database, but I'll add a
table if I really have to.
You can also parse session files in /tmp directory instead of making
database-driven handler but I don't think it's good way.


Nope - it's on a hosted server anyway, so I wouldn't get access to the
/tmp directory.

I guess I'm being lazy, as I thought I could just read the cookies
(as they're set to timeout after an hour).

Adam.
Sep 12 '05 #3

"Adam" <an**@nowhere.com> wrote in message
news:m2********************************@4ax.com...
On Mon, 12 Sep 2005 10:08:29 +0300, Alexey Kulentsov wrote:
Adam wrote:
I'm trying to track who's logged into a site (without setting flags in
the databses).

In php script you have cookies for only current user so you can't do
it without database (SQL or text - doesn't matter)
At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):

Fred
Doris
Bert
etc.


1. Use session for logging users
2. Make database-driven session handler
3. Now you can get list of users by regular SQL query.


I was trying to avoiid touching the current database, but I'll add a
table if I really have to.
You can also parse session files in /tmp directory instead of making
database-driven handler but I don't think it's good way.


Nope - it's on a hosted server anyway, so I wouldn't get access to the
/tmp directory.

I guess I'm being lazy, as I thought I could just read the cookies
(as they're set to timeout after an hour).


read the cookies with what ?

Sep 12 '05 #4
On Mon, 12 Sep 2005 11:40:18 GMT, Zoe Brown wrote:

"Adam" <an**@nowhere.com> wrote in message
news:m2********************************@4ax.com.. .
On Mon, 12 Sep 2005 10:08:29 +0300, Alexey Kulentsov wrote:
Adam wrote:
I'm trying to track who's logged into a site (without setting flags in
the databses).
In php script you have cookies for only current user so you can't do
it without database (SQL or text - doesn't matter)

At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):

Fred
Doris
Bert
etc.

1. Use session for logging users
2. Make database-driven session handler
3. Now you can get list of users by regular SQL query.


I was trying to avoiid touching the current database, but I'll add a
table if I really have to.
You can also parse session files in /tmp directory instead of making
database-driven handler but I don't think it's good way.


Nope - it's on a hosted server anyway, so I wouldn't get access to the
/tmp directory.

I guess I'm being lazy, as I thought I could just read the cookies
(as they're set to timeout after an hour).


read the cookies with what ?


Exactly!! I don't know! As is apparent, I don't know much about
cookies - other than I thought they were also stored on the server ...
and therefore [somehow] accessible.

Of course, it's highly probable that I'm barking up the wrong tree -
and should read up on session management.

Adam.
Sep 12 '05 #5

"Adam" <an**@nowhere.com> wrote in message
news:4q********************************@4ax.com...
On Mon, 12 Sep 2005 11:40:18 GMT, Zoe Brown wrote:

"Adam" <an**@nowhere.com> wrote in message
news:m2********************************@4ax.com. ..
On Mon, 12 Sep 2005 10:08:29 +0300, Alexey Kulentsov wrote:

Adam wrote:
> I'm trying to track who's logged into a site (without setting flags in
> the databses).
In php script you have cookies for only current user so you can't do
it without database (SQL or text - doesn't matter)

> At the moment, each user gets a cookie with "Usr_Name" set if
> authentication goes through OK.
>
> Is there a way of looping through ALL the values of a particular
> cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
> (say):
>
> Fred
> Doris
> Bert
> etc.

1. Use session for logging users
2. Make database-driven session handler
3. Now you can get list of users by regular SQL query.

I was trying to avoiid touching the current database, but I'll add a
table if I really have to.

You can also parse session files in /tmp directory instead of making
database-driven handler but I don't think it's good way.

Nope - it's on a hosted server anyway, so I wouldn't get access to the
/tmp directory.

I guess I'm being lazy, as I thought I could just read the cookies
(as they're set to timeout after an hour).
read the cookies with what ?


Exactly!! I don't know! As is apparent, I don't know much about
cookies - other than I thought they were also stored on the server ...
and therefore [somehow] accessible.

Of course, it's highly probable that I'm barking up the wrong tree -
and should read up on session management.


wrong tree, they are stored on the clients machine...

Adam.

Sep 12 '05 #6
Adam <an**@nowhere.com> wrote:
I'm trying to track who's logged into a site (without setting flags in
the databses).

At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):


No. This information is not stored on your server. Fred's cookie comes in
with every request Fred sends, but unless you are storing it somewhere, the
cookie goes away as soon as the request is sent.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Sep 15 '05 #7
On Thu, 15 Sep 2005 00:40:29 -0700, Tim Roberts wrote:
Adam <an**@nowhere.com> wrote:
I'm trying to track who's logged into a site (without setting flags in
the databses).

At the moment, each user gets a cookie with "Usr_Name" set if
authentication goes through OK.

Is there a way of looping through ALL the values of a particular
cookie, eg $_COOKIE['Usr_Name'] ... that would give me an output of
(say):


No. This information is not stored on your server. Fred's cookie comes in
with every request Fred sends, but unless you are storing it somewhere, the
cookie goes away as soon as the request is sent.


Yep ... sounds logica. Thanks for the enlightenment (and to all other
posters). !!

Adam.
Sep 15 '05 #8

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

Similar topics

13
by: G | last post by:
Hello, Is it possible to send form values from PAGE1 to PAGE2, and then retain the form info for PAGE3 without using cookies, sessions or DB storage? Also, I dont want to repost page2 to page3...
1
by: Ravi | last post by:
Hi , i am trying to pass the same session Id to all the webrequest, but sometimes the response.cookies returns zero and sometimes one. is this to do something with cookies expire. In this sample...
0
by: tshad | last post by:
I can add a cookie fine, but I can't seem to figure out how to change the value of a cookie and save it back. My code looks like: if (passwordSaveCookie.checked) then If...
2
by: David | last post by:
Using VS2005 and ASP.Net. I am going between 2 aspx pages. I set cookies in page 1, go to page 2 and then return to page 1 via postBackURL. When I get back to page 1 all of the cookie values are...
10
by: veerapureddy | last post by:
Hai everybody, I am facing a problem with cookies. Actually what i am doing is, user will enter uesrname and pasword in one url loginpage, after success , iam redirecting the user to...
2
by: zensunni | last post by:
I'd like to assign an array to a cookie. But, I can't incrementally assign cookie names, thus, I can't assign different values. Here is the code that should work, but doesn't let me. count = 0...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
3
by: Sylvie | last post by:
When redirecting a page, For example CASE 1; Response.Redirect("Page.aspx?Paramval=123"); in Page.aspx
1
by: srinivasyadavkota | last post by:
Hi Experts here, Pls help. In my WebApplication from Home page(i.e parent window) i am sending the values to child window(i.e popup page) In the popup page(i.e child window) I am storing the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.