473,706 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to reset a session variable at logout?

127 New Member
i am calculating the users break time...

when the user logged in the break time will be assigned to him... say 60 mins..

the user take several breaks... for example in first break he used 20 mins and second break 30 mins and so on..

i calculate the remaining break time from every break the uyer takes. the problem is when user logged in next time the break time is not reseting to 60 mins... the break time variable holds the last value.. it not reseting to 60 mins...



when the user logout, it automatically set the break time to 60 mins... how to do it?

so next time the user logged in it must show the break time is 60 mins...

how to do it? plz help.
Oct 27 '10 #1
2 1949
dlite922
1,584 Recognized Expert Top Contributor
Just overwrite the session variable in the login script.

// login
// authentica
// reset session time ($_SESSION['break_time'] = 60);

Dan
Oct 29 '10 #2
impin
127 New Member
i tried but not working...
this is my script.

Expand|Select|Wrap|Line Numbers
  1.  
  2. include('config.php');
  3. session_start();
  4. $user_check=$_SESSION['login_user'];
  5. $ses_sql=mysql_query("select uname from user where uname='$user_check' ");
  6.  
  7. $row=mysql_fetch_array($ses_sql);
  8.  
  9. $login_session=$row['uname'];
  10.  
  11. $_SESSION['break_time']=3600;
  12.  
  13. if(!isset($login_session))
  14. {
  15. header("Location:home.php");
  16. }
  17.  
  18.  
Oct 30 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
14656
by: Jeff | last post by:
I've searched the web for hours trying to figure out this problem and can't seem to find any pertinent answers. I have a website where the user starts on a login page, puts in their credentials and hits a submit button, which then takes the user to a 2nd PHP page which simply runs PHP code that checks the user's credentials from my database, and if authenticated creates a session, assigns a few session variables (including a session...
1
7996
by: Jenna | last post by:
Hi all, Do you know how to reset session.timeout after user click to extend the session timeout? For example, default session.timeout is 20 mins and 2 mins before will ask whether extend working on the site or logout. Thanks
1
1902
by: farooqazeem | last post by:
Hi guys, I’m facing some problem can u solve it. Problem is: I’m giving user Id and password in (Login_sess.asp) and submit it to page (sess_test.asp). I am setting session variable (session(“Sin”)=”Yes”) just before redirecting to the same page, but in first time I do not received the value of session variable when I redirect it, when I execute this process second time or redirect it only with the page name...
14
5200
by: Bobby | last post by:
I have this line, at this time the value of Session("Login") is 1: Response.Write "<a href=" & Request("script_name") & _ "?action=show&o=" & rsCustOrders("OrderID") & _ ">" & rsCustOrders("OrderID") & "</a>" Once you click on it, it refreshes the page and goes to the following section, and somehow the value of Session("Login") is 0, hence, it ends up in the ELSE trap:
2
2014
by: dave | last post by:
Hi all I'm newbie to asp.net and building simple pages using vb.net. I have got three pages default.aspx (which is login page), index.aspx and logout.aspx. In logout.aspx i have put following code... Session.Clear() Session.RemoveAll() Session.Abandon()
6
8355
by: Vyoma | last post by:
This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I have been lurking around at several forums with regard to login and user authentication scripts and I have got as far as this: - Starting a session - Registering a session variable - Using the variable to check if the user is authenticated or not. - Authenticating the user through MySQL database - Logging of the user, by setting the...
25
2437
by: Jonno | last post by:
Hi I am having a problem with session vars being propagated between pages on this site: http://www.meettheancestors.com/sessiontest/index.php If you enter any user id and password and click Log In (no actual validation is performed), and then move around the other pages and/or keep refreshing the pages it will eventually display something that is incorrect i.e. saying your logged in when you aren't or vice versa. The exact same code...
6
5674
by: laredotornado | last post by:
Hi, When a user logs into our site, we create a session variable to denote the session is active and another to denote who is logged in. Once the user closes the browser and re-opens it, the session is destroyed and the variables are gone. How can I keep the session alive for 24 hours even if the user closes and re-opens the browser?
1
2854
SHOverine
by: SHOverine | last post by:
Recently my web host decided to "upgrade". This change rendered many of my pages useless and I am scrambling to fix the issues, so you may see several posts from me in the coming days. My first issue is that all of my dropdown menus are passing the last row to the next page as the session variable. The pages that I am talking about can be found at: Weekly13_Test The code that follows was operational until the change. Here is my...
0
1684
by: itsmenarwal | last post by:
HI everyone 1. As user enter username and password in sign-in-form.php then values are collected in sign-in-action-form.php page and the i am storing username into session variable like this In database i have a table named employee <a href="logout_file.php">Sign Out</a> if (username and passwords are matched) { session_start(); $_SESSION = $row; $_SESSION =$row;
0
9286
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9156
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9055
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8997
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7911
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6615
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4453
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2502
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2095
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.