LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-26-2021, 08:41 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 924

Rep: Reputation: 61
Red face Why do my web sessions keep expiring?


Currently running a LAMP server at my office.

The staff would like to not have to re-log in so often through out the day.

I have set my
Code:
session.cookie_lifetime
to 0 (that means infinite right?) and yet their sessions still keep expiring. Do I need to adjust something in Apache2 as well?

Cheers! Any tips welcome!
 
Old 11-27-2021, 01:27 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by wh33t View Post
Currently running a LAMP server at my office.

The staff would like to not have to re-log in so often through out the day.

I have set my
Code:
session.cookie_lifetime
to 0 (that means infinite right?) and yet their sessions still keep expiring. Do I need to adjust something in Apache2 as well?
There's not enough info here about what you are serving.
Could be it sets its own session cookies, or has another way of terminating the session.
Are you talking about some CMS with login capabilities?
It could also overwrite the value of session.cookie_lifetime, or you could have edited the wrong config file, or you could've done it wrong, etc.

Lastly, a quick web search(tm) pulls up a lot of info; what reading/troubleshooting have you done already?
 
1 members found this post helpful.
Old 11-27-2021, 07:26 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,827

Rep: Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964
0 means until the browser is closed.

As posted not enough information. What type of script is running, did you write the code? There could be some fixed timeout value in the code itself to timeout the session.
 
1 members found this post helpful.
Old 11-27-2021, 11:18 AM   #4
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 924

Original Poster
Rep: Reputation: 61
This is all code I have written, no framework, no cms. It's an inventory tracking system, it's accessible only on our office network. No public access. I have set session.gc_maxlifetime to 14400, which should be 4 hours. I'll see if that makes a difference. Startpage brought back many results duck.com did not. Cheers all.

There is no code written to automatically terminate the session.
 
Old 11-27-2021, 04:59 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,827

Rep: Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964Reputation: 5964
Without seeing an example of your code it is difficult to say why it isn't working as expected.
 
1 members found this post helpful.
Old 11-27-2021, 05:10 PM   #6
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,648

Rep: Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564Reputation: 2564

For a server, cookies are just HTTP headers. If the correct header values are sent at the correct times then it's not a server issue - but without access to the code and the server, nobody here can say if that's happening or not. (Though I wouldn't be surprised if an expiry value is being set once at login and not updated per request.)

Press F12 to open Developer Tools, select the Network tab, then trigger a request and inspect the HTTP headers.

You can also check Storage>Cookies.

 
1 members found this post helpful.
Old 11-27-2021, 06:36 PM   #7
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 924

Original Poster
Rep: Reputation: 61
I'd absolutely post some code if there was code to post. I have not written in any code to terminate sessions other than logging out. The ending of sessions in question is related to a server setting.

Since I increased the value of session.gc_maxlifetime in my php.ini file I have not yet experienced a session timing out, so I think that was the setting I needed to adjust. Appreciate the responses guys!

Cheers.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Expiring CA ?? michael_util Linux - Security 1 11-19-2004 03:14 PM
Mozilla mail and expiring old e-mail automatically dalek Linux - Software 8 07-14-2004 07:43 AM
expiring users acid_kewpie LQ Suggestions & Feedback 10 04-15-2004 01:13 PM
expiring passwords in kerberos with AD acb67 Linux - Security 1 10-31-2003 01:22 PM
account expiring zovres Linux - Newbie 1 09-16-2003 06:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration