?
Solved

how to destroy session after some time

Posted on 2004-04-27
4
Medium Priority
?
1,005 Views
Last Modified: 2008-01-09
hi,
  I'm registering a session for user of mysite, using fuctionsession_destroy();
session_start();
session_register("user");
$user = $username;

but i want that if there is no activity by user for last one hour then automatically destroy his session,
can we register  expire time with session
    Is there any way to store session for some time,
0
Comment
Question by:callshakeel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 10

Accepted Solution

by:
eeBlueShadow earned 100 total points
ID: 10936154
Hi,
  You need access to your php.ini file. In it, find the setting "session.cache_expire" and set it to 60.

_Blue
0
 
LVL 2

Assisted Solution

by:Warble
Warble earned 100 total points
ID: 10940591
You can also set this in the code:

session_cache_expire(1440); // set expire to 1440 minutes or 1 day.
session_set_cookie_params(86400); // Cookie expire after 86400 seconds, or 1 day.

You must set both of these.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question