Questions tagged [session]
The session tag has no summary.
75 questions
2 votes
1 answer
201 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 ...
1 vote
1 answer
385 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 ...
0 votes
0 answers
127 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 ...
1 vote
1 answer
216 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 ...
2 votes
1 answer
179 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 ...
0 votes
1 answer
179 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 ] ] ...
3 votes
1 answer
711 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 ...
1 vote
1 answer
705 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 ...
2 votes
1 answer
283 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 ...
1 vote
1 answer
113 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\...
1 vote
1 answer
595 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->...
0 votes
0 answers
73 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 ...
1 vote
0 answers
329 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=...
1 vote
1 answer
361 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 ...
3 votes
1 answer
801 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: &...