473,503 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When/How PHP session expire? Can I set it in minutes of inactivity?

I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire. How do I check if session id exists? If I can do
these two things then I can store the session id for a user in a
database and everytime he requests an action I can just check if the
session id is active or expired. If active let him continue if
expired request to relogin. If the user tries to login and the
session id is active then reports that the id is still active and he
must either log out of the session or wait till it expires. How would
I accomplish this? Thanks

Ryan
Jul 17 '05 #1
4 39491
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();
Jul 17 '05 #2
Is session_cache_expire the number of minutes from start to end or the
number of minutes from the last activity? Thanks for your help I
can't seem to find the answer in the PHP manual.

"rostik" <ro****@tower.ntu-kpi.kiev.ua> wrote in message news:<bv**********@news.ntu-kpi.kiev.ua>...
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();

Jul 17 '05 #3
see session.gc_maxlifetime, session.cookie_lifetime in your php.ini.
If you are unable to edit it, see ini_set(); function

"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
Is session_cache_expire the number of minutes from start to end or the
number of minutes from the last activity? Thanks for your help I
can't seem to find the answer in the PHP manual.

"rostik" <ro****@tower.ntu-kpi.kiev.ua> wrote in message

news:<bv**********@news.ntu-kpi.kiev.ua>...
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();

Jul 17 '05 #4
"rostik" <ro****@tower.ntu-kpi.kiev.ua> wrote in message news:<bv**********@news.ntu-kpi.kiev.ua>...
"Ryan Hubbard" <ry*********@yahoo.com> wrote in message
news:59**************************@posting.google.c om...
I would like to limit multiple logins for a user. How and when does
the session id expire? Can I set it so after x minutes of inactivity
it would expire.


session_cache_expire();

How do I check if session id exists?

session_is_registered();


Are you really helping him??

To the OP:

Manual is your friend.
<http://in.php.net/manual/en/ref.session.php> Change your INI settings
to various values and learn.

Search the archive and Google for nice login scripts.

--
"Success = 10% sweat + 90% tears"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4398
by: Daniel Bengs | last post by:
Hi there... I've got a problem where a normal string variable loses its value after session_start() is called. The funny thing is, that this only happens for some people, and they are using IE6,...
5
2421
by: Jennifer Smith | last post by:
We have an environment running ASP on IIS5, where a user logs in via an ASP login page and an entry is made to the database recording the users login time and a database session. If the user then...
24
2424
by: Nancy Drew | last post by:
hi all i'm trying to keep users from being able to login to a site twice at the same time. everytime a user does a login, i stick their userID into an application scoped array. if they try to...
2
3457
by: brian | last post by:
I have my session timeout at 20 minutes. Is there a way to set session time per variable. For instance: I create session("TEST") and I want it to expire in 2 minutes of no activity...Is that...
1
3080
by: caldera | last post by:
Hi, I want to check the session timeout finished in a minute. If there is a minute, it sends a web page to caution the users. If he/she want to continue he/she press the continue button . I was...
4
7991
by: Daniel Geisenhoff | last post by:
Hi, we have set our session timeout in web.config and in IIS to 1 minute, but the session never expires. We check a variable Session("UserId") in global.asax, which is still valid after 10...
12
6940
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
17
5176
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
0
4226
by: dadasurf80 | last post by:
Hello, I've a problem with Axis which gives me a "Session alreday invalidated" message after a time of inactivity. I use: - Tomcat : 4.1.29 - Axis : 1.3 - JVM : 1.4.2-b28 The complete...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.