Session randomly expires/logs out
Permalink
On my local install, i have no issues with logging in and STAYING logged in without having to enable the "stay logged in for 2 weeks" checkbox.
On the production server, i'm experiencing random log outs.
These are the steps I take to login:
1. go to login page
2. enter credentials
3. redirected to landing page with edit bar on top
4. I click on any of the edit options (pencil, add pages, etc) and I get an "access denied" notification.
If I enable the "stay logged in for 2 weeks" option, i don't experience these issues.
Any ideas what's going on here. It's pretty frustrating because most users won't enable the option to stay logged in for 2 weeks.
On the production server, i'm experiencing random log outs.
These are the steps I take to login:
1. go to login page
2. enter credentials
3. redirected to landing page with edit bar on top
4. I click on any of the edit options (pencil, add pages, etc) and I get an "access denied" notification.
If I enable the "stay logged in for 2 weeks" option, i don't experience these issues.
Any ideas what's going on here. It's pretty frustrating because most users won't enable the option to stay logged in for 2 weeks.
Hi there,
sure...here it is:
sure...here it is:
# concrete5 Version Core Version - 5.7.5.1 Version Installed - 5.7.5.1 Database Version - 20150713000000 # concrete5 Packages None # concrete5 Overrides blocks/custompl/tools/preview_pane.php, blocks/custompl/tools, blocks/custompl/controller.php, blocks/custompl/view.css, blocks/custompl/auto.js, blocks/custompl/add.php, blocks/custompl/edit.php, blocks/custompl/db.xml, blocks/custompl/view.php, blocks/custompl/icon.png, blocks/custompl/page_list_form.php, blocks/custompl/rss.png, blocks/custompl/templates/videos/view.css, blocks/custompl/templates/videos/view.php, blocks/custompl/templates/videos, blocks/custompl/templates/latest_articles/view.php, blocks/custompl/templates/latest_articles, blocks/custompl/templates/latest_grid/view.css, blocks/custompl/templates/latest_grid/view.php, blocks/custompl/templates/latest_grid, blocks/custompl/templates/frontpage_view/view.css, blocks/custompl/templates/frontpage_view/view.php, blocks/custompl/templates/frontpage_view, blocks/custompl/templates/category_view/view.css, blocks/custompl/templates/category_view/view.php, blocks/custompl/templates/category_view, blocks/custompl/templates, blocks/custompl, blocks/awards_landing/controller.php, blocks/awards_landing/add.php, blocks/awards_landing/edit.php, blocks/awards_landing/db.xml, blocks/awards_landing/view.php, blocks/awards_landing/icon.png, blocks/awards_landing/form.php, blocks/awards_landing/config.json, blocks/awards_landing, blocks/addvideo/controller.php, blocks/addvideo/add.php, blocks/addvideo/edit.php, blocks/addvideo/db.xml, blocks/addvideo/view.php, blocks/addvideo/icon.png, blocks/addvideo/form.php, blocks/addvideo/config.json, blocks/addvideo, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, themes/sample/category.php, themes/sample/search.php, themes/sample/full.php, themes/sample/page_theme.php, themes/sample/fonts/glyphicons-halflings-regular.ttf, themes/sample/fonts/glyphicons-halflings-regular.svg, themes/sample/fonts/glyphicons-halflings-regular.eot, themes/sample/fonts/glyphicons-halflings-regular.woff, themes/sample/fonts/glyphicons-halflings-regular.woff2, themes/sample/fonts, themes/sample/js/jquery-1.11.3.min.js, themes/sample/js/html5shiv.min.js, themes/sample/js/respond.min.js, themes/sample/js/html5shiv-printshiv.min.js, themes/sample/js/jwplayer6/jwplayer.js, themes/sample/js/jwplayer6/jwplayer.html5.js, themes/sample/js/jwplayer6/jwplayer.flash.swf, themes/sample/js/jwplayer6, themes/sample/js/bootstrap.min.js, themes/sample/js, themes/sample/common/cm_pagelist.php, themes/sample/common/footer_elements.php, themes/sample/common/logo_search.php, themes/sample/common/navigation.php, themes/sample/common/landing_js.js, themes/sample/common/head_elements.php, themes/sample/common, themes/sample/page_forbidden.php, themes/sample/thumbnail.png, themes/sample/images/main_thmb_04.jpg, themes/sample/images/ls-04.jpg, themes/sample/images/awards-badge.gif, themes/sample/images/latest-thmb-02.jpg, themes/sample/images/ls-03.jpg, themes/sample/images/Teamworkhockey.jpg, themes/sample/images/ls-02.jpg, themes/sample/images/examplequote.gif, themes/sample/images/latest-thmb-03.jpg, themes/sample/images/has-video-xs.gif, themes/sample/images/mqdefault2.jpg, themes/sample/images/TravelTheWorld.jpg, themes/sample/images/main-content-img6.jpg, themes/sample/images/main-content-img3.jpg, themes/sample/images/hd_bg_04.gif, themes/sample/images/main_thmb_03.jpg, themes/sample/images/main-content-img4.jpg, themes/sample/images/slide4.jpg, themes/sample/images/slide1.jpg, themes/sample/images/main-content-img5.jpg, themes/sample/images/the-sample-logo.png, themes/sample/images/main_thmb_02.jpg, themes/sample/images/sample_intro.jpg, themes/sample/images/slide3.jpg, themes/sample/images/latest-thmb-01.jpg, themes/sample/images/sampleLogoReverse.png, themes/sample/images/latest-thmb-05.jpg, themes/sample/images/main_thmb_01.jpg, themes/sample/images/main-content-img2.jpg, themes/sample/images/latest-thmb-04.jpg, themes/sample/images/play_btn.png, themes/sample/images/sb_r_logo.png, themes/sample/images/mqdefault3.jpg, themes/sample/images/ls-01.jpg, themes/sample/images/openquote1.gif, themes/sample/images/has-video.gif, themes/sample/images/white-play-btn.png, themes/sample/images/slide2.jpg, themes/sample/images/samplers-everywhere.jpg, themes/sample/images/youtube-play-button-icon-910258.png, themes/sample/images/vingette.png, themes/sample/images/mqdefault1.jpg, themes/sample/images/BNS10day.png, themes/sample/images/samplesite.live_edit.jpg, themes/sample/images/Locks-and-guards.png, themes/sample/images/bg1.gif, themes/sample/images/bg1xl.gif, themes/sample/images/main-content-img1.jpg, themes/sample/images, themes/sample/page_not_found.php, themes/sample/article.php, themes/sample/video.php, themes/sample/description.txt, themes/sample/css/style_bd.css, themes/sample/css/style.css, themes/sample/css/font-awesome.min.css, themes/sample/css/bootstrapxl.css, themes/sample/css/_style_backup.css, themes/sample/css/pingendo.css, themes/sample/css/bootstrap.css, themes/sample/css, themes/sample, blocks/custompl/tools/preview_pane.php, blocks/custompl/tools, blocks/custompl/controller.php, blocks/custompl/view.css, blocks/custompl/auto.js, blocks/custompl/add.php, blocks/custompl/edit.php, blocks/custompl/db.xml, blocks/custompl/view.php, blocks/custompl/icon.png, blocks/custompl/page_list_form.php, blocks/custompl/rss.png, blocks/custompl/templates/videos/view.css, blocks/custompl/templates/videos/view.php, blocks/custompl/templates/videos, blocks/custompl/templates/latest_articles/view.php, blocks/custompl/templates/latest_articles, blocks/custompl/templates/latest_grid/view.css, blocks/custompl/templates/latest_grid/view.php, blocks/custompl/templates/latest_grid, blocks/custompl/templates/frontpage_view/view.css, blocks/custompl/templates/frontpage_view/view.php, blocks/custompl/templates/frontpage_view, blocks/custompl/templates/category_view/view.css, blocks/custompl/templates/category_view/view.php, blocks/custompl/templates/category_view, blocks/custompl/templates, blocks/custompl, blocks/awards_landing/controller.php, blocks/awards_landing/add.php, blocks/awards_landing/edit.php, blocks/awards_landing/db.xml, blocks/awards_landing/view.php, blocks/awards_landing/icon.png, blocks/awards_landing/form.php, blocks/awards_landing/config.json, blocks/awards_landing, blocks/addvideo/controller.php, blocks/addvideo/add.php, blocks/addvideo/edit.php, blocks/addvideo/db.xml, blocks/addvideo/view.php, blocks/addvideo/icon.png, blocks/addvideo/form.php, blocks/addvideo/config.json, blocks/addvideo, languages/fr_FR/LC_MESSAGES/messages.mo, languages/fr_FR/LC_MESSAGES, languages/fr_FR, languages/tr_TR/LC_MESSAGES/messages.mo, languages/tr_TR/LC_MESSAGES, languages/tr_TR, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/pl_PL/LC_MESSAGES/messages.mo, languages/pl_PL/LC_MESSAGES, languages/pl_PL, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, themes/sample/category.php, themes/sample/search.php, themes/sample/full.php, themes/sample/page_theme.php, themes/sample/fonts/glyphicons-halflings-regular.ttf, themes/sample/fonts/glyphicons-halflings-regular.svg, themes/sample/fonts/glyphicons-halflings-regular.eot, themes/sample/fonts/glyphicons-halflings-regular.woff, themes/sample/fonts/glyphicons-halflings-regular.woff2, themes/sample/fonts, themes/sample/js/jquery-1.11.3.min.js, themes/sample/js/html5shiv.min.js, themes/sample/js/respond.min.js, themes/sample/js/html5shiv-printshiv.min.js, themes/sample/js/jwplayer6/jwplayer.js, themes/sample/js/jwplayer6/jwplayer.html5.js, themes/sample/js/jwplayer6/jwplayer.flash.swf, themes/sample/js/jwplayer6, themes/sample/js/bootstrap.min.js, themes/sample/js, themes/sample/common/cm_pagelist.php, themes/sample/common/footer_elements.php, themes/sample/common/logo_search.php, themes/sample/common/navigation.php, themes/sample/common/landing_js.js, themes/sample/common/head_elements.php, themes/sample/common, themes/sample/page_forbidden.php, themes/sample/thumbnail.png, themes/sample/images/main_thmb_04.jpg, themes/sample/images/ls-04.jpg, themes/sample/images/awards-badge.gif, themes/sample/images/latest-thmb-02.jpg, themes/sample/images/ls-03.jpg, themes/sample/images/Teamworkhockey.jpg, themes/sample/images/ls-02.jpg, themes/sample/images/examplequote.gif, themes/sample/images/latest-thmb-03.jpg, themes/sample/images/has-video-xs.gif, themes/sample/images/mqdefault2.jpg, themes/sample/images/TravelTheWorld.jpg, themes/sample/images/main-content-img6.jpg, themes/sample/images/main-content-img3.jpg, themes/sample/images/hd_bg_04.gif, themes/sample/images/main_thmb_03.jpg, themes/sample/images/main-content-img4.jpg, themes/sample/images/slide4.jpg, themes/sample/images/slide1.jpg, themes/sample/images/main-content-img5.jpg, themes/sample/images/the-sample-logo.png, themes/sample/images/main_thmb_02.jpg, themes/sample/images/sample_intro.jpg, themes/sample/images/slide3.jpg, themes/sample/images/latest-thmb-01.jpg, themes/sample/images/sampleLogoReverse.png, themes/sample/images/latest-thmb-05.jpg, themes/sample/images/main_thmb_01.jpg, themes/sample/images/main-content-img2.jpg, themes/sample/images/latest-thmb-04.jpg, themes/sample/images/play_btn.png, themes/sample/images/sb_r_logo.png, themes/sample/images/mqdefault3.jpg, themes/sample/images/ls-01.jpg, themes/sample/images/openquote1.gif, themes/sample/images/has-video.gif, themes/sample/images/white-play-btn.png, themes/sample/images/slide2.jpg, themes/sample/images/samplers-everywhere.jpg, themes/sample/images/youtube-play-button-icon-910258.png, themes/sample/images/vingette.png, themes/sample/images/mqdefault1.jpg, themes/sample/images/BNS10day.png, themes/sample/images/samplesite.live_edit.jpg, themes/sample/images/Locks-and-guards.png, themes/sample/images/bg1.gif, themes/sample/images/bg1xl.gif, themes/sample/images/main-content-img1.jpg, themes/sample/images, themes/sample/page_not_found.php, themes/sample/article.php, themes/sample/video.php, themes/sample/description.txt, themes/sample/css/style_bd.css, themes/sample/css/style.css, themes/sample/css/font-awesome.min.css, themes/sample/css/bootstrapxl.css, themes/sample/css/_style_backup.css, themes/sample/css/pingendo.css, themes/sample/css/bootstrap.css, themes/sample/css, themes/sample # concrete5 Cache Settings Block Cache - Off Overrides Cache - Off Full Page Caching - Off Full Page Cache Lifetime - Every 6 hours (default setting). # Server Software Apache/2.2.3 (CentOS)
Viewing 15 lines of 50 lines. View entire code block.
Hmmmm nothing overly odd there (although on an unrelated note I would recommend bumping up your version of PHP if at all possible to 5.5).....
It could be that your host is deleting session files on some sort of regular basis, but if you say it's random that's probably not the case either.
Something else you could try would be to move your sessions to the database. I can't say how this will affect performance but it might be worth a shot.
create a file /application/config/concrete.php (if one doesn't already exist). Set the session handler to be the database by making the file look like this (if you have other things in the file don't remove them, merge the arrays or seek additional help):
It could be that your host is deleting session files on some sort of regular basis, but if you say it's random that's probably not the case either.
Something else you could try would be to move your sessions to the database. I can't say how this will affect performance but it might be worth a shot.
create a file /application/config/concrete.php (if one doesn't already exist). Set the session handler to be the database by making the file look like this (if you have other things in the file don't remove them, merge the arrays or seek additional help):
Thanks for the quick reply.
The production site is not on a shared host, and after some digging could not find anything that indicates sessions are being removed.
Sessions are currently stored in /var/lib/php/sessions, and ownership of the sessions folder seems correct.
We're actually running two websites off the said server with two different CMS. For some reason, only Concrete seems to randomly kick users out.
I'm wondering if it has something to do with our custom theme. Is there anything in the theme that would cause something like this to happens?
The production site is not on a shared host, and after some digging could not find anything that indicates sessions are being removed.
Sessions are currently stored in /var/lib/php/sessions, and ownership of the sessions folder seems correct.
We're actually running two websites off the said server with two different CMS. For some reason, only Concrete seems to randomly kick users out.
I'm wondering if it has something to do with our custom theme. Is there anything in the theme that would cause something like this to happens?
It's possible with anything custom that something might be clearing out the session or improperly handling it, but I would most likely expect to see repeatable results with that. Also, are both your CMSs running on the same domain name or different ones?
I tried your code above, setting the session handler to be the database, cleared the cache, cleared session folder on server and still having an issue.
I'm able to login, but within a minute (sometimes a few seconds), it automatically kicks me out.
I noticed 2-3 other posts on this forum, and one specifically in relation to 5.7.
My theme isn't anything elaborate either. it was basically a simple flat HTML which was altered to allow for Concrete editable areas.
it's really strange and extremely frustrating, because you never know when it's going to kick you out =(
I'm able to login, but within a minute (sometimes a few seconds), it automatically kicks me out.
I noticed 2-3 other posts on this forum, and one specifically in relation to 5.7.
My theme isn't anything elaborate either. it was basically a simple flat HTML which was altered to allow for Concrete editable areas.
it's really strange and extremely frustrating, because you never know when it's going to kick you out =(
Does the site switch betweenhttp://www.site.com and site.com? (notice the www before it)
Also, is it possible that you're on a different domain after login? Something like logging in fromhttp://www.example.com/login and being redirected tohttp://example.com/?