I am using this block of code for mannual logout but i want automatic logout after 5 minutes of inactivity on website. How to do that?  Thanks   &lt;?php session_start(); error_reporting(E_ALL); ini_set('display_errors', '1'); session_destroy();  if(!session_is_registered('username')) {   header("location: logout_msg.html"); } else {   print "&lt;h2&gt;Could not log you out, sorry the system encountered an error.&lt;/h2&gt;"; }  exit(); ?&gt;
23072
I need to keep a session alive for 30 minutes and then destroy it.
100231
When solving this issue (  ), I did a function so that the plugin would auto-hide from all users except one (me:).  The flaw is that it only auto-hides when active.  At first, it was a mu-plugin, but I had to enable/disable it manually. It really doesn't need to run all the time, as it may slow the site (?) or even contain some sensitive manipulation of the site's language (another question mark).  But mainly the motivation is that I don't want the client activating/deactivating/deleting this plugin (is for my own use), and don't want it cluttering her own plugins list.  So, decided to split the functions in two plugins:   One is a Must-Use used to hide the regular one.  The other will be activated/deactivated upon necessity and is the one from the above linked issue.   But now I run into another question: how to hide one plugin from the Must-Use listing?
72189
I have the following implementation of HttpSessionlistener  public class SessionListener implements HttpSessionAttributeListener, HttpSessionListener {   public void attributeAdded(HttpSessionBindingEvent event) {    ...  }   public void attributeRemoved(HttpSessionBindingEvent event) {      ... }  public void attributeReplaced(HttpSessionBindingEvent event) {  }  //HttpSesion creation &amp; destruction public void sessionCreated(HttpSessionEvent event) {     HttpSession session = event.getSession();     //log created time   }  public void sessionDestroyed(HttpSessionEvent event) {     HttpSession session = event.getSession();     long destroyedTime = System.currentTimeMillis();     //log destroyed time  }   }  Basically i log the session creation and destruction time. But if the session is long (default to 30 minutes), and user closes browser meanwhile, the   sessionDestroyed    is not called ?  Why is that ?  Is there a workaround to log exactly the when the session was destroyed (when user closes the browser)? Should'nt be this be the browser's problem, to kill the session when it is closed ?  Is there any interface that i have to implement for this to work ?  Thank you !
70961
I am looking for a method built-in to ubuntu that will allow me to run a script or program or whatever for a fixed period of time.  , but the package is unavailable for Ubuntu. In any case, I was hoping for something built-in.  The only thing i can think of is to get the current time and set a cron job 30 minutes from 'now' that will kill the program.  I was hoping there was a way to do this without setting up a script, but if I need to - it wont be the end of the world. After the 30 minute interval I would like to put my laptop in a sleep mode, but this can be separate from the timer thing.  Thanks in advance.
31106
I have created the following function for checking the connection status:  private void checkConnectionStatus() {     HttpClient httpClient = new DefaultHttpClient();      try {       String url = "http://xxx.xxx.xxx.xxx:8000/GaitLink/"                    + strSessionString + "/ConnectionStatus";       Log.d("phobos", "performing get " + url);       HttpGet method = new HttpGet(new URI(url));       HttpResponse response = httpClient.execute(method);        if (response != null) {         String result = getResponse(response.getEntity());         ...   When I shut down the server for testing the execution waits a long time at line  HttpResponse response = httpClient.execute(method);   Does anyone know how to set the timeout in order to avoid waiting too long?  Thanks!
31894
I have heard mixed responses on this topic, so what is a sure fire way to destroy a PHP session?    session_start(); if(isset($_SESSION['foo'])) {    unset($_SESSION['foo'];    ... } session_destroy();   In the most simple of cases, would this sufficient to truly terminate the session between the user and the server?
118630
How would you go about turning you computer after a specified amount of time?   I listen music before I go to sleep and would like to be able to shutdown my computer after a specified amount of time. After ½ an hour say.   It would be cool if you could connect a desktop shortcut to a task in scheduler so you click the shortcut and ½ an hour later it shuts down.
6219
I'd like to run a .sh file using bash on logout and shutdown of Ubuntu. I have searched up and down the web and have found only fixes for KDE and GNOME. The script is simple, I just need to know if I can add the line of code to the "logoff/shutdown" file or if I need to reference it in another script.
52828
What is the best way to detect if a user leaves a web page?  The onunload JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).  Creating one will probably be blocked by current browsers.
100843
In Ubuntu 11.04, Ctrl-Alt-Del gives me a menu with shutdown, hibernate, suspend and restart, but no logout. Is there a key combination to logout of Ubuntu? Is there a way to provide one?
69375
Whenever I login to my Linux server I'd like to have several commands run automatically (set some variables, change location, etc.)  This needs to be done on user login, not on system start.  How can I set it to do this?
18821
In the previous version the logout button is under your username, which it can be found by clicking the down arrow. However, in the new version, after a couple minutes of searching, it is under the "site-switcher" button:        This is really illogical since the logout button is usually under your username, including Google and Yahoo! services.  I suggest bringing back the  which will definitely benefit new users and even old users.
85073
I attempted to log out with the following actions:    This accomplished absolutely nothing since I remained logged in after clicking "log out" on the confirmation page. I then tried logging out of Stack Exchange from one of the network sites and repeated the steps above. The results were the same. I remained logged in no matter which combination of steps I performed.  In fact, the only way I could log out at all was to clear all of the cookies that were set.
100032
How exactly do you make an auto-refreshing div with JavaScript (specifically, jQuery)?  I know about the setTimeout method, but is it really a good practice ? Is there a better method?  function update() {     $.get("response.php", function(data) {         $("#some_div").html(data);     });     window.setTimeout("update();", 10000); }
1179
Is a "log out from every SE site in the network" button technically feasible?  With so many SE sites popping up, it would be a very useful feature.  Edit: has this been implemented now, as @Ben suggests in his comment? I've lost track.
104897
I was auto-logged out from the chat.stackexchange.com server. And I couldn't log back in! I reproduced this issue both on Chrome 67 and on Firefox 61, both with regular tabs and Private / Incognito tabs. My OS is macOS 10.13.5.  What I tried:   on chat.stackexchange.com, click the 'login' button (top right, next to the search box). click the log in with Stack Exchange button. fill in my Stack Exchange login credentials. I'm redirected to https://stackoverflow.com/users/login?teamsMember=1, a page that tells me with a red box that I need to log in directly, since I'm a team member:   Fill in my credentials again. Now I'm logged in to Stack Overflow. Return to chat.stackexchange.com, confirm I am not logged in there. Try the same flow again. Log in link, use log in with Stack Exchange, fill in credentials. Now I am taken to a page on Stack Overflow that states I am logged in, and asks me to add another way to log in?     So the log in flow wants me to log in on Stack Overflow, and that log in is never reflected back to Stack Exchange. I can't log in on https://stackexchange.com either. On step 3 I can also use my OpenID URL (which is backed by the Stack Exchange OpenID service for now until I can figure out how to rescue my SEDE account queries) but this has the exact same result.  The work-around is to log into  (or any one of the other *.stackexchange.com sites, such as ), then suddenly chat has me logged in as well, and  acknowledges my account exists too.
69469
I have a bash script that takes several hours to run.  While it's running, I would like to do other things, which may involve logging out or disconnecting from the internet (my script runs network tests on various computers).  I understand that there is a command that would allow me to run my tests from a remote terminal and logout of the terminal while it runs.  Does anyone know what this command is?