PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Thu Feb 12, 2004 7:34 pm
Sorry but I couldn't find it on php.net (
http://us2.php.net/session ) at all..
I did it before, but I just can't remember the syntax.
How do I set a session that gets deleted in say, a second?
and is it possible to do fractions of a second?
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Thu Feb 12, 2004 7:42 pm
ini_set('session.cookie_lifetime', '1'); ?
Not sure about fractions of a second (doubt it), but you can try
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Thu Feb 12, 2004 7:52 pm
hmm.. i mean i want my var to go away in x amount of time..
something like
$_SESSION['var'] = "value", time;
or w/e
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Thu Feb 12, 2004 7:53 pm
Well ini_set('session.cookie_lifetime', '1'); will basically delete the session after 1 second, or do you just want to expire some of the session variables after a certain time? If so, that's slightly trickier.
d3ad1ysp0rk
Forum Donator
Posts: 1661 Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA
Post
by d3ad1ysp0rk » Thu Feb 12, 2004 9:46 pm
ya i do
but i realized my mistake
cookies use times to destroy themselves after x amount of time..
thanks for the help anyways
tim
DevNet Resident
Posts: 1165 Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio
Post
by tim » Thu Feb 12, 2004 10:21 pm
perhaps you are thinking of the:
You can only set it in minutes that I know of...