Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [session]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
41 views

How to inform the front-end user that their session is about to expire?

I have a Craft CMS 4 with forms for logged-in users. Some users may keep certain pages open in their browsers. Sometimes, users submit the form while their session has expired (after one hour, in this ...
Romain P.'s user avatar
  • 1,852
1 vote
1 answer
116 views

Session token error/missing after server switch

I am duplicating a Craft 3 site from a production environment to a dev environment (local with MAMP Pro). On the "new" dev site I can't log into the control panel. The credentials are valid ...
Kirk Roberts's user avatar
0 votes
0 answers
36 views

Creating a User without email requirement and auto-activation from a Controller

I'm working on a project where I use Craft CMS to manage user sessions and store user preferences such as site version and preferred language. However, for privacy reasons (GDPR compliance), I'm not ...
Romain P.'s user avatar
  • 1,852
1 vote
1 answer
136 views

Custom module controller: how to impersonate any user and start its session

From a custom module, I would like to impersonate and start any user session in the browser. This session will be based on a user query result got from a web controller. Something in a way like when ...
Romain P.'s user avatar
  • 1,852
2 votes
1 answer
104 views

How to group SESSION values?

In my Craft service class I need to set SESSION values. Within a method there can be multiple values to be set and depending on what a request to an API returns, there are different keys to save. My ...
Luckyfella's user avatar
0 votes
1 answer
75 views

Multi-Site Craft 3 - How to set defaultTokenDuration to shorter duration for just 1 of the sites?

I currently have a multi-site Craft 3 install with this in the general.php config file (amongst other settings) return [ '*' => [ 'defaultTokenDuration' => 259200, //72 hours ] ] ...
Chad Crowell's user avatar
3 votes
1 answer
459 views

How does Craft CMS handle user's session with Redis

Let's say I installed latest version of Craft CMS (4.2.5) with no plugins or modules or any file that could modify current user's session. Just plain Craft CMS. When I went through records in Redis I ...
Dominik Krulak's user avatar
1 vote
1 answer
450 views

How to make a curl request with a session to an action url?

I am building a onepagecheckout for craft commerce 3. I created a custom controller to submit cart and payment info in one form submit. I'll call the default updateCart action with a curl request and ...
Maarten Heideman's user avatar
2 votes
1 answer
170 views

500 Internal error on admin - session related

I am working on trying to get a local copy of a site working, but ran into an issue where the front end is working, but the admin page is not responding when I try to login. This site is Craft 3.7.44 ...
Rodney Little's user avatar
1 vote
1 answer
76 views

Session Component - Redis

When you configure the session component, I see as session used, pointing to the SessionBehaviour class but what does this do or what does it mean? 'session' => [ 'class' => yii\redis\...
Sean Delaney's user avatar
1 vote
1 answer
388 views

Set Session variable inside php controller

I'm from custom php world but It looks like I can't just set a session variable in plain php. I'm playing around use craft\web\Session; ... $session = new Session(); $session->open(); $session->...
Sylvain Tremblay's user avatar
0 votes
0 answers
50 views

Multiple (dev) sites running locally; session seemingly randomly times out

I've got multiple sites running on XAMPP (I'm on Windows 10). Each has its own domain (eg. dev.example.local, dev.otherexample.local, etc). When I try to have more than one site CP page open in the ...
Sandwich's user avatar
  • 636
1 vote
0 answers
305 views

Craft 3 memcached session storage in load balanced environment

I'm getting the good old session expired popup every minute in the admin panel which is odd given that memcached should be properly configured: php.ini session.auto_start = 0 session.save_handler=...
Max Werner's user avatar
1 vote
1 answer
313 views

Can I manage/change the default flash message text?

I am looking to customise the default flash message text for certain behaviours but cannot seem to find any reference to them in the code or control panel - does this exist anywhere? And could it be ...
iamkeir's user avatar
  • 468
3 votes
1 answer
650 views

How can I debug `craft\web\User::_validateUserAgentAndIp()` warnings

On a production site, we're seeing a ton of the following warning in our web.log files for (seemingly) every request, creating a ton of noise in the logs and making it hard to spot "real" issues: &...
Tom Davies's user avatar
1 vote
1 answer
185 views

Craft 2 Commerce 1 cart session expiry

Is it possible to change the cookie timeout just for the cart? E.g. I'd like to clear abandoned carts after X hours and keep all the other sessions untouched (e.g. user sessions etc). Please advise ...
biko's user avatar
  • 670
0 votes
0 answers
79 views

Craft 3 Session Ended modal popping up on local machine

Using MAMP Pro 5.1 Apache, self-signed SSL cert PHP 7.2.8 module mode OPcache enabcled Extensions: Xdebug, Imagick/ImageMagick Craft 3.1.22 Basically I'm having the same problem as tons of other ...
Max Werner's user avatar
3 votes
3 answers
2k views

How can I store Craft sessions in the database?

Is it possible to configure Craft 3 to store session data in the database? On some other CMS's this can be enabled. The reason I'm exploring this is because we're having an issue whereby PHP sessions ...
Simon East's user avatar
1 vote
1 answer
86 views

Craft 2.6 Session Issues

We are having issues staying logged in to Craft (2.6). There was a plugin error which is what we thought was causing the issues, so we removed the sprout SEO plugin. However the error still persists. ...
Ashton's user avatar
  • 11
1 vote
1 answer
81 views

Craft redirects to domain.tld/domain.tld/ on logout

I have a logout button on my site that points to the logoutUrl. While the logout works and ends the user session, the user is brought to a page with the URL similar to domain.tld/domain.tld/ where ...
stojda's user avatar
  • 163
3 votes
0 answers
116 views

Can you make Craft 2 Stateless?

So we are moving to Google App Engine Flexible which means we cannot store sessions on files. So I wanted to know if anyone has been able to make Craft 2 Stateless and how was it accomplished? Thanks....
juanmrad's user avatar
3 votes
1 answer
61 views

Generating thumbnails when using a memcache server for session storage frequently signs users out

I can't figure out why, but when I'm connected to a memcache server the thumbnail generation process in Assets hangs for long periods of time, the getElements process throws 403 errors, the generating ...
Aaron Bushnell's user avatar
2 votes
1 answer
943 views

Is it possible to change the amount of time a user stays logged in for?

Our users are getting logged out after 1 day. Is there a setting that changes how long users’ sessions will last?
Visky Máté's user avatar
2 votes
1 answer
2k views

Craft CMS 3 - Redis Sessions cause error

I've configured Redis to handle cache and sessions for Craft 3, and while cache configuration is working as expected, I had to disable session configuration due to the below error. It fails on the ...
misteraidan's user avatar
1 vote
1 answer
121 views

Craft 2 CP session expires unexpectedly, requires repeated login

Environment Craft: 2.6.3013 (Personal) MAMP Pro: 4.4.1 PHP: 7.0.12 (CGI Mode) Behavior After logging into the CP, and following a relatively short period of time, the session expires unexpectedly and ...
Chris's user avatar
  • 137
1 vote
1 answer
1k views

Is it safe to remove the craft/storage/runtime/sessions folder?

I'm unable to transfer a site over to my development server because I keep getting problems with disk space. Space is actually fine, it's the number of inodes being used up. Using cPanel I get an ...
Clive Portman's user avatar
1 vote
4 answers
463 views

Migrated site - now dashboard keeps logging out

I've migrated my client's Craft site to a new host. On the front end the site is fine and working as it should. The problem is with the Craft admin area. I can login, but once logged I can’t access ...
Dan B's user avatar
  • 21
1 vote
2 answers
192 views

Craft login problem with memcache and ubuntu?

session_regenerate_id(): Session object destruction failed is the error i'm receiving after attempting to log in. I just updated to Ubuntu 16.04LTS using PHP7 and php-memcached. Is there a fix for ...
Exziled's user avatar
  • 293
1 vote
2 answers
620 views

Control Panel Session 60 second Timeout

I’m on Craft v. 2.6.2983 and am encountering the well flagged issue of the control panel logging me out after 60 seconds. I've tried most of the solutions posted here and have had no success in ...
piaras's user avatar
  • 21
1 vote
1 answer
222 views

Craft cacheMethod setting is being overridden

I am trying to setup Craft to use a memcached (yes it is memcached, not memcache) cluster in AWS ElastiCache to handle sessions. I originally went the route of updating my php.ini file in Apache2 to ...
Manny's user avatar
  • 25
1 vote
2 answers
452 views

Session destroy due to inactivity?

It seems that after x amount of time (somewhere between 30-60 mins?) of inactivity on a page the session is being destroyed/cleared/etc. I will sit on a page with an active session for an hour and ...
Exziled's user avatar
  • 293
1 vote
0 answers
127 views

Problems while setting up a cross region Craft website in AWS

In order to create a cross region setup for my craft website, I've created a read-only replica of my RDS DB from North Virginia region to Canada Central region. I'm facing the internal server error ...
Ankit Sahu's user avatar
1 vote
1 answer
170 views

With two EC2 Craft instances, the Control Panel session keeps expiring

Things were fine (no session logout for admin from CP) when there was only one EC2 instance for our website. I created a replica of the existing EC2 instance and now when I go to Control Panel, ...
Ankit Sahu's user avatar
2 votes
2 answers
1k views

"Your session has ended" modal popping up constantly

I know many other folks have posted this question over the years, but unfortunately none of the answers given so far are fixing this for me. The problem: after logging-in on my staging server (this ...
Derek Hogue's user avatar
1 vote
1 answer
1k views

Redirect issue with login and paths

I'm gonna probably find another way around this, but I'm still very new to Craft and want to ask if I'm missing something obvious. This is a commerce site that needs a front-end login. I have an ...
jrothafer's user avatar
  • 305
4 votes
1 answer
497 views

How can I disable sessions for most of my Craft site?

We're running a craftcms-backed site that uses sessions only for the admin pages. For a few reasons, we'd like to disable session logic for all other urls: the Set-Cookie header that craft uses to ...
Chris MacDonald's user avatar
2 votes
1 answer
799 views

Craft with Redis session handling

We've recently set up a Redis cluster to handle our PHP sessions since we use a load balancer to direct traffic into different craft instances. We're seeing issues with redis when making back to back ...
Exziled's user avatar
  • 293
1 vote
1 answer
974 views

Session cookies

I'm in the process of adding a second site to a Craft installation using custom locales. The two sites will be accessed on different sub-domains, e.g. site1.domain.com and site2.domain.com. I need to ...
Steve Rowling's user avatar
3 votes
1 answer
302 views

Keep on getting logged out when deploying using Capistano

I keep on getting logged out whenever I deploy using Capistrano, despite the sessions being stored persistently (in the craft/storage folder).
Richard Frank's user avatar
1 vote
1 answer
635 views

Getting error "Your session has ended. Enter your password to log back in." every 30 seconds or so

This is happening for all users and only on production environment. "Your session has ended. Enter your password to log back in." Entering your password does not allow you to actually see the admin ...
Ian O'Brien's user avatar
1 vote
1 answer
200 views

conditional does not run first in a file that is included using the extends feature for twig

I have this conditional included in a layout file I use within others, using the extends feature in twig. This is at the very top of _layouts/application.twig {% if not currentUser %} {% ...
Brad's user avatar
  • 487
1 vote
1 answer
409 views

Implementing SimpleSAML PHP in Craft plugin

We have been trying to implement SimpleSAML PHP in a Craft plugin to facilitate a SAML login for one of our sites. The problem we are running into is that we always get the NOSTATE error. The ...
Frank Zwiers's user avatar
1 vote
1 answer
297 views

How do I preserve user sessions across subdomains?

I have defaultCookieDomain set to .site.com I am logged into www.site.com I expected to also be logged into sub.site.com (which is pointing to the same web root), but I'm not. What am I missing?
Tim Kelty's user avatar
  • 3,081
3 votes
1 answer
1k views

Using PHP Redis as Session Store

I'm trying to use php-redis as the session store to my craftcms site. What I've tried: apt-get install php5-redis Edited php.ini with the following: session.save_handler = redis session.save_path = "...
Erez Rabih's user avatar
1 vote
2 answers
9k views

Session related question - opening browser with multiple tabs

We are having a situation wherein the users are trying to open URLs in the same browser with multiple tabs, while doing that the session variables which store unique identifiers are overwritten. Is ...
Anand Vyas's user avatar
1 vote
0 answers
219 views

Plugin event listener not firing

In my plugin I have an init() method: public function init () { parent::init(); require CRAFT_PLUGINS_PATH.'/myplugin/vendor/autoload.php'; $this->callTemplateHooks(); craft()-&...
Russ Back's user avatar
  • 1,503
1 vote
1 answer
215 views

Craft/Yii not garbage collecting session?

I want to store a session value and have that cleared after a set timeout. I’ve got PHP's session.gc_maxlifetime set at 60 seconds for development and am using Craft’s HttpSessionService to set a ...
Russ Back's user avatar
  • 1,503
1 vote
1 answer
563 views

Strange issue with logging out user on frontend

We have a strange issue with a site we are developing. We have a user login on the front-end of the site which takes users to their profile pages. The issue we have is that on a Mac the user is being ...
Lettie's user avatar
  • 2,033
1 vote
2 answers
239 views

How can I disable/decrease the number of calls to getAuthTimeout?

The host of a client is claiming the call to getAuthTimeout is triggering their firewall, and in turn blocks my client from accessing their site for a longer duration. Is there a way to disable or ...
Fred Carlsen's user avatar
  • 2,997
0 votes
0 answers
258 views

Property "Craft\SessionRecord.token" is not defined

I'm trying to log in to the admin area of an local install but all that happens is the page refreshes and nothing happens. Digging deeper I found this in the log: 2016/03/09 09:16:38 [error] [...
Alec Ritson's user avatar
  • 4,539