Storing data for future visits

From: Francisco (fran575_at_mailandnews.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 12:26:00 -0300

I have this problem:
I have a database with information about games, and users are able to vote
for them. Everytime a user votes for a game I store the unique game name
into a session variable (an array). So if they are in a page were they
already voted, they won't have the option to do so.
The idea is that the session cookie lasts "forever", I don't want them
voting for the same game everytime they get to the site. This isn't soo
strict, I don't care if some few users don't accept cookies and eventually
vote 2 times for the same game.
So what I did is to have a session cookie with a very large expire time and
I noted that the session variable data is stored in my server
in /temp/sess_blabla
my questions are:

1. how much does this data last?, can I make it last forever with
session_cache_expire()?
I still don't like this solution, data would be lost if I change the server,
I would prefer that the client store this info with his session ID so:

2. I've searched and read that you can store data in a cookie, but coudln't
find the way to do it. Can I store this variable in the users session
cookie?, how?

3. Any better idea?, maybe storing this info in the database?

Thank you. I hope I was clear.

Francisco



Relevant Pages

  • Re: Storing data for future visits
    ... Everytime a user votes for a game I store the unique game name ... >into a session variable. ... >vote 2 times for the same game. ...
    (comp.lang.php)
  • Re: Obveeus thoughts on Micronesia finale
    ... it into the game and the fact that he got removed through an injury. ... For reasons unknown, you only included eight of the final ten players, ... Erik--too trusting, too dumb, too easily swayed by virtually everyone ... I guess in a vote to give someone 100k, ...
    (alt.tv.survivor)
  • Re: =?utf-8?Q?La_teor=C3=ADa_de_los_juegos?=
    ... más racional en una democracia es no votar ... but the Good Samaritan Game suggests that even ... Real people seldom think ... rational thoughts about whether or not to vote. ...
    (soc.culture.argentina)
  • Re: =?utf-8?Q?La_teor=C3=ADa_de_los_juegos?=
    ... coloquialmente el libro que les recomende: Game Theory: A Very Short Introduction, pag 27, coloquialmente para los que se inician: ... but the Good Samaritan Game suggests that even ... Real people seldom think ... rational thoughts about whether or not to vote. ...
    (soc.culture.argentina)
  • Re: Could Terry Be The Best ?
    ... played the social game well at all. ... line on her tribe to being in the inner circle. ... you guys are going to have to vote each other out. ... rather than being the bottom three of your bigger alliance. ...
    (alt.tv.survivor)