BFD Calendar

Session expires

6 posts in this topic

The $config->sessionExpireSeconds in config.php is set to 86400 but still I have to log in as admin after about 10 minutes of inactivity. Any other hidden corners where I should look to set this right?

$config->sessionChallenge is set to true.

$config->sessionFingerprint is set to false.

Share this post


Link to post
Share on other sites

I'm pretty sure your problem is in PHP's session.cookie_lifetime setting. You can check the value with

echo ini_get('session.cookie_lifetime');

There are many ways to change it - for an example you can just put this in your config.php

ini_set('session.cookie_lifetime', 86400);
3 people like this

Share this post


Link to post
Share on other sites

sforsman, thanks but that didn't solve the problem. Tried with different browsers from different locations on different computers... I have other sites with same provider and same config.php setup and no problem there. It remains a mystery to me.

echo ini_get('session.cookie_lifetime'); says 86400

Share this post


Link to post
Share on other sites

@BFD Calendar Have you tried to set the $config->sessionExpireSeconds to something small like 30 sec or smthn to test if that line works or is considered at all... because I have a similar problem. I want to do some tests with session expiration, but when I change $config->sessionExpireSeconds to something small like 30 sec... it doesnt work in my case... I dont even know how long the session time is in my case... tried to wait like an hour without any activity and was still logged in... So yeah would appreciate if someone shares some knowledge on this issue...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Slav
      Hey Guys! Im new to PW and am working on a website built on PW. Im trying to understand how sessions work in PW. Specifically what exactly is happening when session expires. The thing is that my client wants to be redirected to homepage whenever session expires, so basically he doesnt want to be redirected to admin login page when he's in the admin environment of PW(he doesnt want his clients to see the admin login page for whatever reason). Is it possible to hook to the session expiration and redirect to a specific url? And what is the correct way to do it in PW?
      I would appreciate the help!
      Cheers!
    • By Karl_T
      Greetings. I am here to share my first module. I make this module because I cannot find one to suit my need. I like SessionHandlerDB but I do not want to use mysql database to store session for performance. So, Redis seems to be the best choice. I have tried to use netcarver's SessionHandlerRedis but it lacks something I need, those are the active session checking and the easy module configuration while I do borrow some code from it (thanks to netcarver). So I take this chance to merge them together to form a new module. I am new to use github and I don't know if it is appropriate to publish another similar project, or fork from them. 
      You may grab this from Github: SessionHandlerDBRedis
      I hope this could give somebody a help.
       
      Caution before use: this module lacks support for session lock. It will be implemented for the next update.
       
      Updated to v0.3
      changelog: 
      v0.3 - added ability to get forwarded IP instead of normal remote IP. 
    • By Dennis Spohr
      Hi all,
      I have problems to keep my session on different subdomains (including www).
      I've set the following config:
      $config->sessionCookieDomain = '.mydomain.net'; $config->sessionCookieSecure = false; But it doesn't work, I always loose the session when I switch between www.mydomain.net and example.mydomain.net.
      Could it be because both of them have a different SSL-Certificate? (https)
      Thanks for any help!
      Dennis
    • By martind
      hi,
      i have a login form on my page which is handled within a template called by ajax. Login works fine, but only if the site doesn't get reloaded - which isn't the intention but may occur. So is there a way to manually reset the session data from within my form-handler template after successfully calling $session->login($username, $password), to have it working after a page reload?
      thanks, martin
    • By Harmen
      Hi all,
       
      Currently I am working on a filter for all the products in a category. So I've set up a class and built a (PW) form in it. When the user clicks on continue the form should return a processform function which sets the variable of the form in a session. Later in the file I want to read out that session and use that variable to select which products should show up and which should be hidden. So now with code examples to make it a bit more clear for you:
       
      In my file I start with a class:
      class classname { public function ShowForm() { $form = $this->Form1(); if ($this->input->post->submit) { if ($this->processForm1($form)) $this->session->redirect("./"); } return $form->render(); } Then a form inside the class:
      protected function Form1() { $form = wire('modules')->get("InputfieldForm"); $form->description = "Fill in the fields to find the mouse which fits your wishes"; $form->label = "Mouse Selector"; $form->action = "./"; $form->method = 'post'; $f = wire('modules')->get("InputfieldRadios"); $f->name = "Hand"; $f->label = "label"; $f->addOption(1, "1"); $f->addOption(2, "2"); $form->add($f); $this->addSubmit($form, 'Continue'); return $form; } This function is called when the user submits:
      protected function ProcessForm1($form) { $form->processInput($this->input->post); $this->session->hand = (int)$form->get("Hand")->value; } As you see I store the variable of the submitted form in a session. After closing the class I continue with building the page and then I want to read out that variable:
      $value = $this->session->hand; $content .= "Value of 'Hand': " . $value; But when I execute this on my website I cannot see the value of the form. Have I done something wrong or how can I fix this?
      Thanks in advance,
      ~Harmen