Re: Get values for ALL cookies?



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.
.



Relevant Pages

  • Re: eCommerce/Shopping Cart Experience
    ... There will be a customer database included ... ... Session is fine, but in my experiences, ... for the most part, those that disable cookies, also disable session cookies ... I in no way guarantee the effects of scripts posted ... ...
    (microsoft.public.inetserver.asp.db)
  • Re: How to pass value of one page to another page
    ... OK then try cookies, or a database, etc. ... process has memory leakage problem, ... thats why I want to pass variable data between form without using Session ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: eCommerce/Shopping Cart Experience
    ... I will be open sourcing my shopping cart within the 3 months. ... There will be a customer database included ... ... Session is fine, but in my experiences, ... for the most part, those that disable cookies, also disable session cookies ...
    (microsoft.public.inetserver.asp.db)
  • Re: How to keep some data or flag between invocations of my script ?
    ... I know the php script is read from the hard disk on every hit anyway, and my two pages include 3 or 4 other scripts, plus other database accesses, but I was just trying to avoid one more disk access, if possible. ... So I decided I have to use cookies. ... then I would check a variable in my php session. ...
    (comp.lang.php)
  • Re: Please! Doesnt anyone know a better way to do this?
    ... account, they need to automatically be directed to the page to enter data ... session variable on the Account page. ... I assume here that you're checking a database when the user attempts to ... When a new user attempts to login or clicks to register, ...
    (microsoft.public.dotnet.framework.aspnet)