473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to reset a session variable at logout?

127 100+
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 1938
dlite922
1,584 Expert 1GB
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 100+
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
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...
1
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...
1
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...
14
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") & _ ">" &...
2
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...
6
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...
25
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...
6
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...
1
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.