How to expire a session

Thread Solved

Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

How to expire a session

 
0
  #1
Nov 25th, 2005
I am new with session.

What i am trying to do is that if someone doesn't visit my site for lets say 5 day i want the session to expire. is there a way to do this as i am not aware of it.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #2
Nov 26th, 2005
Sessions are set automatically by the server on page load, and the default life of a session is 20 minutes. If you are overriding this setting (which is acceptable) and you are setting it to ndays (which is highly unnacteptable) then you are putting an incredibly heavy load on your server memory and will cause a whole load of pain for yourself.

It may help our understanding of your situation if you detail exactly what sessions you are refering to and how they are being assigned.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #3
Nov 29th, 2005
then tell me this when an a session expire is it deleated on the server as i use sessons and they just take a lot of space on the server because for some reason they are just gathering there
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #4
Nov 30th, 2005
Have you changed the default session lifetime? How are you setting the sessions?

As stated, server sessions are managed automatically by the server, but some of the defaults can be overridden by code.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #5
Nov 30th, 2005
I havent messed with any part of my server as i use yahoo server and they dont let me change any thing in it.

If you wana look at my server setting you can find them at http://www.eezs.com/test/test.php
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #6
Nov 30th, 2005
Well the server settings are all kinda standard, so no problem there. I noticed you are setting a cookie named BX and you have set a life of 5 years on it. Is this what you are referring to?
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #7
Dec 1st, 2005
I have no idea what that cookie is so i dont need 2 worry about it but is there a way to forcefully expire sesson and delete it from the server so they dont just sit there and pile up.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #8
Dec 1st, 2005
Still have no idea what sessions you are refering to. Can you post a screenshot of the sessions you are talking about? Where are the 'sessions' being stored? If you are physically setting a session variable or persistent cookie then you can delete/expire/unset that session variable based on a time calculation. If the session variable is a server generated session variable then it will expire automatically based on the lifetime setting in the server.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #9
Dec 2nd, 2005
basically what i am asking is how to expire session after certain period of time.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: How to expire a session

 
0
  #10
Dec 2nd, 2005
There are couple of methods depending on how the sessions are set and how much of the session data you actually want to destroy.

Have a look at using session_destroy, session_unset, unset('$_SESSION['$varname']), or session_write_close. Descriptions and details of their use can be found on php.net.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC