Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 20th, 2011, 02:39 AM
Authorized User
Points: 223, Level: 4
Points: 223, Level: 4 Points: 223, Level: 4 Points: 223, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default login using sessionid or time

hi all,
i have written a code in php using sessions.below is the code......

Code:
<?php
if(!isset($_SESSION)) 
{
 session_start();
}
$now = time();
$limit = $now;
if(isset($_SESSION['last_activity']) && ($_SESSION['last_activity'] < $limit)) 
{
 $_SESSION = array();
 header('Location:logout.php');
 exit;
} 
else 
{
//the current time
$_SESSION['last_activity'] = $now;
}
?>
.
tell me how to modify in the above code that if the user is entering for first
time then using time() or sessionid it should be stored
or else if he is entering for first time then using current time() or sessionid
it must be stored.....
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to reset the SessionID? akkad C# 2 October 24th, 2007 06:49 AM
question about login and "remember me next time" hertendreef ASP.NET 2.0 Professional 0 February 14th, 2007 06:29 AM
single user login at a time dayarprasad MySQL 1 June 23rd, 2006 11:08 PM
only one login allowed at a time using one userid chayanvinayak PHP How-To 2 May 1st, 2006 01:54 PM
How to Generate my own SESSIONID anand_asv .NET Framework 2.0 0 March 2nd, 2005 09:14 AM



All times are GMT -4. The time now is 06:27 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.