Skip to main content

Questions tagged [session]

Denotes questions about session management in Magento.

Filter by
Sorted by
Tagged with
1 vote
2 answers
2k views

Magento get Customer Data from session id

I've create a login function that make the customer login by email and password and return below response { "status": "success", "message": { "id": "1", "name": "username", ...
1 vote
6 answers
4k views

adminhtml/session addError not showing after redirect

I am working on a custom magento admin module with grids. When you add a new entry, I perform custom validation and throw an error (when & if it occurs) using Mage::getSingleton('adminhtml/session'...
1 vote
1 answer
2k views

Uncaught Exception: Warning: SessionHandler::open(): Cannot call session save handler in a recursive manner

I move my magento project from localhost to shared server. Now since mod_version was not installed and the hosting provider said that enabling the module was not covered of the plan. So I followed the ...
2 votes
1 answer
2k views

Magento Clears Session Data After Redirect

For some reason, magento clears session or customer session data after redirect? How will I save some data before it redirect to the next page into a session? I tried adding session_write_close(); ...
0 votes
2 answers
2k views

Magento 2.1.10: How to override Magento\Framework\Session\SessionManager

I'm looking for solution for override. Magento\Framework\Session\SessionManager I use the usually way (preference in di.xml), but no hope. di.xml <?xml ...
0 votes
1 answer
2k views

PHPSESSID set SameSite=NONE

PHPSESSID cookie is set to default sameSite= lax, how to change it to sameSite=none?
0 votes
0 answers
16 views

How to fix Magento's built-in session management that conflict with how GTM handles sessions causing session regeneration issue

Anyone have this issue before, I notices even in a freshly installed magento 2.4.4p4 commerce edition this issue occur Let me know if this is the correct page to post this issue or I should post this ...
0 votes
0 answers
27 views

Magento 2.4.4p4 EE - GTM Session Regeneration on Every Page Load

I'm encountering a discrepancy between user/session activity and transaction count in Google Analytics (GA) for a Magento 2.4.4p4 Enterprise Edition project. The culprit seems to be frequent GTM ...
2 votes
1 answer
2k views

Magento 2 - Cookies are not secure

I was wondering if there is a setting for creating secure cookies on M2. I have a vulnerability check and it shown that cookies don't have "secure" tags. Or do I need to override a core function?
0 votes
0 answers
20 views

Uncaught TypeError: t.options.map is not a function (Magento 2.4.4p4)

I'm encountering the following error when accessing Magento 2.4.4p4: ds.min.js:1 Uncaught TypeError: t.options.map is not a function at u (ds.min.js:1:1998) at ds.min.js:1:2563 at Array.map (<...
0 votes
1 answer
3k views

Magento 2 language changes not working properly, Only works for first time when i switch

Languages not switching properly. Only works when language parameter www.website.com/?___store=german exits into the url but when i click on the other pages then usually parameter will be removed from ...
0 votes
1 answer
3k views

Magento 2 : set value in session from js file

I want to save string from js file in session because i want to use that value in controller. How to save value in session from js file. I want to save one string which size is 200kb. so i want to ...
7 votes
2 answers
7k views

Is there a way to pass a coupon code as a URL parameter?

I would like to create URLs which activate a specific coupon. It could be as simple as passing the coupon code as a URL parameter. When a coupon is passed, I'd like it to automatically be populated ...
0 votes
0 answers
8 views

AJAX and pure JS API token request break user session

API token request break user session if logged in, but request successful. The result is the same for $.ajax and pure JS fetch Tested on two projects let url = '<?php echo $this->getUrl('...
7 votes
6 answers
6k views

Maintain cart for a week in Magento 2?

I am building a Magento 2 store. The Cart is saved for one hour only, it get deleted after one hour of inactivity. Is there any setting on Magento that allow a longer (may be a week or so) cart ...
2 votes
2 answers
356 views

Where does Magento 2 save session?

Where does Magento 2 save session files? According to the documentation, it is possible to save in the database, in redis, in memcache or in files, but in the default installation it looks like this. ...
0 votes
0 answers
76 views

Add to Cart Not Working After Upgrade to 2.4.6.-p3

after upgrading to Magento version 2.4.6-p3 , Add to cart not working, it just shows adding and then nothing happens. also when I go from category page with options products , it does not shows any ...
33 votes
18 answers
69k views

Unable to login to admin (no error message) stuck at login screen

This will be a self-answer to a problem that is pretty old but recurring. I remember struggling on this back in the days when I was setting up Magento 1.9 and it occurred again this time around on ...
1 vote
1 answer
2k views

Magento 2- Redirect customer to home page after customer session expires instead login page?

i want to redirect the customer to the home page after session get expired. Right now it get redirected to the login page. How can i achieve it. Any help welcome.
4 votes
4 answers
8k views

Error "Your session has expired" when click on add to cart in magento 2.3

I am new in magento, I am creating website in magento 2.3 and I have installed FreeGo theme in my magento website. But when i click on product's add to cart then it's giving me error--> Your ...
2 votes
4 answers
9k views

Magento 2 Admin Page Error: Your current session has been expired

Fresh Install of Magento 2.2.2 on Centos (Plesk) with Apache 2.4, php 7.0.2 + all modules, mariaDb 10.1. Magento Installation was done via browser wizard -> readyness check-> everything was ok. When ...
9 votes
4 answers
4k views

Correct way to obtain a session object?

I'm writing a payment module for Magento 2 right now and I'm checking it against the "Magento Extension Quality Program Coding Standard" CodeSniffer(https://github.com/magento/marketplace-eqp). For ...
1 vote
0 answers
643 views

How is PHPSESSID cookie being set in Magento 2?

The only place I could find where the cookie actually not being initialized but renewed on every request is renewCookie() function in Magento\Framework\Session\SessionManager. Whenever there is a new ...
2 votes
2 answers
6k views

How to get customer session id in magento 2?

I want to get the session-trail in a custom module. Without the session-related code, it is working fine, but it breaks the module when I add it namespace Scaledesk\Trails\Block; use \Magento\...
1 vote
0 answers
279 views

Problem with session of magento 2.4.5

whenever I activate the option 'Validate REMOTE_ADDR' it happens this error. I don't know what to do... The "remote_addr" session value is invalid. Verify and try again. and in admin, i'm ...
0 votes
1 answer
169 views

Magento 2 Admin Panel is Very Slow

Right now, my admin panel is very slow. I wait min 15 sec to load every grid. I created new account and logged in with it. There isn't any problem, it loads with 2-3 sec. What should i do?
9 votes
5 answers
13k views

Can we increase the system/security/session size at admin On Magento 2

I need to know, Is there any side issues, if we increase the below path size more than max in config file. system/security/max_session_size generally as per magento max size is 256000 Can we ...
30 votes
5 answers
102k views

Magento 2 - How to get all items in cart?

At checkout page (chekout/cart) I want to edit the checkout button url destination based on cart items (link.phtml). How can I get all items in cart? I want to do this without using the API. Thanks.
1 vote
3 answers
764 views

How to increase session time of magento 2.4 admin panel

It is annoying to log in to the magento admin every few minutes, I find this solution to increase the time I hope it helps you en la version actual 2.4 debes ir Store-> Configuración-> Avanzado-&...
2 votes
2 answers
4k views

Magento 2.2 keep logging out

My magento installation is keep logging out when login with admin account. Sometimes 3 mins, some times 10 mins. After log in, it shows: All other open sessions for this account were terminated....
0 votes
1 answer
426 views

Magento 2: LastRealOrderId is missing in checkoutSession

I am facing this weird issue on the checkout page. We are using 3rd party payment module, which redirects customer to the payment page after placing order in Magento. In the controller, it tries to ...
1 vote
2 answers
7k views

Magento 2 checkout session

Is there any way to store checkout custom field data to checkout session? If possible how can I retrieve data? Created an event <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/...
1 vote
0 answers
542 views

Redis connection errors (session handling)

I am using Redis cache for session storage in my Magento 2.4.3-p2 based store. The app/etc/env.php setting looks like 'session' => [ 'save' => 'redis', 'redis' => [ 'host' =&...
0 votes
1 answer
237 views

which data was saved in table session Magento 2?

I configured session that would be saved to database in file app/etc/env.php. Now, table session has expanded to large size (~4GB). I want to open my mind which data that Magento saved in table ...
19 votes
4 answers
17k views

Understanding Magento Registry

I have been wondering always, where is all the registry data stored in Magento ? I know that even singleton objects are stored in the registry. And registry is just a static array variable of the ...
2 votes
1 answer
278 views

Duplicate cart items

community! Bumped into an issue - duplicate items in a cart. In the quote table, I have multiple quotes for the same customer. Items_count is increased like an exponent, eg 2, 3, 6, 178, 192. In the ...
1 vote
0 answers
209 views

Session Message Redirect in separate function

Before redirecting I set an error message on the session like this Mage::getSingleton('core/session')->setError('ERROR::Please enter all fields'); session_write_close(); $this->...
4 votes
4 answers
6k views

How can I load a quote by session ID?

If have the frontend session ID, how can I load the quote associated with that?
5 votes
4 answers
20k views

Magento 2: how to call checkout session in controller?

Please anyone tell me, how to call checkout session in module's controller? this method doesn't work for me <?php namespace Demo\Demo\Controller\Demo; class Demo extends \Magento\Framework\App\...
3 votes
1 answer
1k views

Customer Session

I am using the Magento customer session to store some data. I want it to be destroyed when a customer logs out. However (customer/session) still persisting the data. One way is I can unset data on the ...
1 vote
1 answer
1k views

delete session files older than one day, not working

I would like to clean session files older than one day. I clean with cron with this find /path/to/magento/var/session/ -mtime +1 -exec rm {} \; and my cron setting is to run once a day, so 0 0 * * ...
0 votes
1 answer
282 views

Registry & Services

Can Any body explain me Why Magneto used registry and now why we use Services for what purposes instead of Registry.
2 votes
3 answers
2k views

Magento 2: Get Admin session in frontend

How can i get the admin session in frontend. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $adminSession = $objectManager->create('Magento\Security\Model\...
5 votes
2 answers
1k views

Why core session is empty?

I have a custom module, which basically adds social media login in magento. However I am facing an issue with core/session which I dont know how to resolve. I am adding my custom blocks in customer ...
3 votes
1 answer
957 views

When does Magento decide to give a guest a new visitor_id? Cart gets empty sometimes

When does Magento decide to give a guest a new visitor_id? I noticed many entries in log_visitor table, and session_id often is replicated many times, and that makes cart get empty sometimes for some ...
1 vote
1 answer
862 views

Magento 2 where session data is stored (see example)

I'm trying to figure out how magento is hiding quote ids on client side I've checked quote mask ids table, but this id is not there, so leaves me to guess its in session data "jQuery.localStorage.get('...
0 votes
2 answers
668 views

Magento 2.3.5p2: The "system/security/max_session_size_admin" path doesn't exist

I am getting this error when I run the command: bin/magento config:set system/security/max_session_size_admin 0 Error: The "system/security/max_session_size_admin" path doesn't exist. Verify ...
0 votes
2 answers
2k views

How to fix admin session issue to login to the admin panel?

After upgrading my Magento 2 I see this error message all the time I try to log in via the admin panel. The frontend pages are working fine. Fatal error: Uncaught TypeError: strtotime() expects ...
1 vote
0 answers
19 views

Showing previous $_GET results when pressing back

I have a table controlled by a dropdown box. My dropdown for example has all animals, lion, crocodile, and wolf. When I press lion results show fine, I then click crocodile and again results are fine ...
0 votes
1 answer
73 views

your session has expired 2.3

Hello I am trying to install magento 2.3.5 p1 on my mac with mamp pro. My base url looks as follows http://magmono:8888/ After I add a product to a card I get an error that session has expired. The ...

1
2 3 4 5
13