Questions tagged [session]

Denotes questions about session management in Magento.

198 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
691 views

Magento 2 The session id is too long

I am running Magento 2.2 on php7.1 and getting the following errors in my var/report and on my error log: > {"0":"Warning: SessionHandler::read(): The session id is too long or contains ...
5
votes
1answer
183 views

Is the session table supposed to be cleaned up automatically?

So we have a 20 Mio rows, 20 GB size session table. Is this supposed to be cleaned up automatically and that is a bug in our customization or is this a feature? I will run DELETE FROM session ...
4
votes
0answers
351 views

Magento 2.2.8 session_start slow in profiler

We have multiple Magento 2.2.8 websites on one domain (domain.com = Website A, domain.com/store = Website B - separate customer accounts, but often people are registered on both). We're having ...
4
votes
0answers
765 views

Magento2: Local-Storage Mage-Storage and Mage-Cache Empty on every Reload

Many features in my web page break as when I investigated, I found out that many local storage keys don't even exist now which used to exist before. list of keys that don't exist: lo_session mage-...
4
votes
0answers
101 views

I have Chinese chars in the contents of my session files. Have I been hacked?

I've noticed that my /var/session/ folder has been filling up really quickly lately so I decided to open a few of the files up to see where they were being generated from. Most of them were bots such ...
3
votes
0answers
157 views

How to add "httponly" attribute set on existing cookie ? (Magento 1)

In Magento 1 I can see many of the cookie are without Secure flag and HttpOnly set on website. Is their any way to set Secure flag and HttpOnly set on all server Cookie ? I need to make all server ...
3
votes
0answers
75 views

Export sessions data from files to REDIS

We are moving from single server to multiple server setup for our store. The problem is that we are using file cache type and we want to preserve those sessions (long expiration, per management ...
3
votes
1answer
477 views

How can I hide the errors session messages of my module?

In Magento 2, it shows an error which is really annoying for customers. How can we hide or remove showing those errors in the page? Currently, the application is in the production mode. But still, ...
3
votes
1answer
306 views

Can't access session into admin phtml file on Magento 2

I tried to set a session from a model file and access this on a phtml file like this and it's not working: namespace/vendor/Model/ProcessModel.php: protected $backendSession; public ...
3
votes
3answers
827 views

problem adding items to cart from outside magento

I'm having this problem and getting pretty annoyed by it. here's the situation. I was running a website on the codeigniter framework, and our customer wanted to add a shop to sell a couple of ...
3
votes
0answers
2k views

Magento 2 SessionHandler error

Sometimes my magento 2 store returns this error "Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /var/www/vhosts/domain.net/httpdocs/...
3
votes
0answers
421 views

Can't getCustomer isLoggedIn magento2?

I try get custommer is login. it not success. this is my code protected $_customerSession; public function __construct( ... \Magento\Customer\Model\Session $customerSession, .... ){ ... $this->...
3
votes
2answers
217 views

Confused by multiple, conflicting 'Last Logged In' Stats

This is an example of a customer page on the backed. It shows two fields, 'Last Logged In:" and "Last Logged In(America/Los_Angeles):", which is the home timezone of the store. I am confused at what ...
3
votes
1answer
938 views

Customer Session

I am using the magento customer session to store some data. I want it to be destroyed when customer logs out. However (customer/session) still persisting the data. One way is I can unset data on log ...
3
votes
1answer
816 views

Getting the last viewed category on a product page?

We would like to add a link "view all other [category name] products" on the product page. We tried several things no full success. it seems there is a last viewed category methode Mage::...
2
votes
0answers
70 views

Redirect to Magento2 website with session id

We have a small requirement like a punchout payload concept. The user will redirect to Magento 2 website from 3rd party with the session_id. We want to capture that session_id and implement our logic. ...
2
votes
0answers
33 views

How to get the data from the Session in a CustomerData Object without breaking the guidelines?

9.10. The Request, Session, and Cookie objects MUST NOT be injected in an object constructor. They MUST be passed only as method arguments. from the Technical guidelines How to comply with this rule ...
2
votes
0answers
252 views

Magento 2 Increase guest session time and keep the items in cart for 20 days

I want t increase guest user session time in magento. If guest user add to cart and just go for lunch or any other activity putting his/her website open in browser, when user come after 5-6 hours ...
2
votes
0answers
693 views

Magento EE: session_start(): Unable to clear session lock record

Magento Enterprise Edition 1.14.0.1 PHP 7.2.15 PECL memcached extension 3.1.3 We encountered this problem upgrading Magento EE from PHP 5.6 to PHP 7.2. We do not see the problem using the memcached ...
2
votes
0answers
339 views

Strange behavior with the redirects in Store views, Cms pages, Cookies

Config : Front : I have Two store views 1:simple, 2:pro. Admin : 1Website->1StoreGroup->2Storeviews: simple and pro Cms Pages : I created different Cms pages, let's taking for example : 2 (A,B) ...
2
votes
0answers
310 views

Magento 2 : Lifetime, scope and general usage for all types of sessions

There are a lot of session types in magento 2 . The ones I know of are listed below ; 1) \Magento\Catalog\Model\Session //vendor/magento/module-catalog/Model/Session.php 2) \Magento\Newsletter\...
2
votes
0answers
158 views

How to create a session and share with iframe in magento 2 API

The username and password will be send from third party service by cURL or something to Magento application. So now we need to create session in Magento application for shared customer details and ...
2
votes
2answers
470 views

magento 2 session

In my installation of the Magento 2.2. I have a strange misbehavior related to sessions. Specifically: I can't get any data from session after the browser page has been refreshed. As result I have ...
2
votes
0answers
30 views

How to get the session from Magento 2.1.9

I am not able to get the session from Magento 2.1.9. How to get it for the integration of Magento with SAP?
2
votes
0answers
23 views

Advice on most performant approach to get variables once per session

I need to pass deviceType and userState(IL, IN, IA, KS, etc) variables to GTM for marketing purporses and wondering what’s the best way to do it. To calculate deviceType I will use mobiledetect php ...
2
votes
0answers
216 views

Magento 2: Session Information

Magento 2 has multiple session types. I know that each type gives you access to different information ie current customer information. The sessions I know of are: \Magento\Backend\Model\Session \...
2
votes
0answers
438 views

Changing the currency format in index page

I am trying to set the currency format in My magento store based on the option selected by the customer. When customers click on an option in the header I am redirecting them to a page called check....
2
votes
0answers
220 views

Cross-Domain Session sharing is not working Magento 1.9.2

I have 2 stores set up in two different domain names in one Magento Installation. I have enabled the SID on Frontend to share the session between the two stores using SID as an Url parameter. But it ...
2
votes
1answer
887 views

Magento - how to extend login session time on php.ini or htacess

I'm user of Magento and out website is supported by web hosting company, simplehelix. I want to extend our website session time because the remaining time of login is too short. I already set the ...
2
votes
0answers
95 views

Magento 2.1 : Cannot retrieve session variable

Im trying to save form token in session variable and get it back in the result page when the form is submitted. I created the following Session Model to handle sessions in my custom module: <?php ...
2
votes
0answers
174 views

Can I create a URL to send in email which will open a specific cart by id?

I'm implementing an abandoned cart email solution. Is it possible in Magento to access a given cart simply by clicking a URL with the cart id somewhere? E.g. something like: https://www.mystore.com/...
2
votes
1answer
828 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 ...
2
votes
1answer
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(); ...
2
votes
1answer
221 views

https with SID not working

I made multiple stores in the sub directories(language is store name). And all the stores use https. But the problem is that when i switch to another store, it become logged out automatically. In ...
1
vote
0answers
99 views

main.ERROR: Notice: Trying to access array offset on value of type int

Losing access to our admin panel and exception log is showing: main.CRITICAL: Notice: Trying to access array offset on value of type int in /home/andy/public_html/vendor/magento/framework/Session/...
1
vote
0answers
74 views

Magento 2 Varnish caching add to cart session from another user

When adding an item to cart, it will also show a second item, which I have previously added to cart from a different device. If I bypass varnish cache, cart seems to work ok. Guess I am missing a ...
1
vote
0answers
21 views

Share session within different domains

I have one website, one store and multiple store views. One store view has different domain. I want this store view to have the same session, if product is added in one store view, should be also ...
1
vote
0answers
35 views

Magento 1 configuration in .htaccess is not working

In magento i have added the below configuration in .htaccess file php_value session.cookie_secure 1 php_value session.cookie_httponly 1 <IfModule mod_php5.c> php_value session.cookie_httponly ...
1
vote
1answer
51 views

cannot get session value in different events

I'm using two different events controller pre dispatch and controller post dispatch.I have set customvalue using catalogsession in predispatch event and try to get the value in post dispatch event....
1
vote
1answer
42 views

My local.xml file doesn't have a session tag defined. Is it normal?

I was wondering changing the way Magento deal with sessions and for my surprise I discovered my /app/etc/local.xml doesn't have a session_save tag set. Is it seems to be a problem? Is it safe to set ...
1
vote
1answer
732 views

Magento 2.3.3 - Varnish session issue

I'm having a bug with the Varnish Caching and after investigating and searching for a solution, I'm still not able to solve the problem. The FPC is working fine most of the times, but sometimes the ...
1
vote
0answers
21 views

Why do I see action notification messages on other pages?

Sometimes when I added products to the cart or I type wrong my password, I see the warning message in the checkout success page. How could I fix it?
1
vote
0answers
73 views

Magento 2 set and access variables between controllers

I have a problem with storing and accesing variables accross controllers. i have controller 1 there i set variable ( tried registry and session ) in block of that controller i have both and registry ...
1
vote
0answers
25 views

Admin session time out issue in Magento 1.9

Admin Config settings: System => Configuration =>Web => Session Cookie Management => set Cookie Lifetime 259200. And Go to => System => Configuration => Admin => Security => set Session Lifetime ...
1
vote
0answers
26 views

Cookie Management

Looking at adding functionality to the Cookie consent, instead of just accepting them I would like to add a new button which takes you to the a new page where you can select which cookies you would ...
1
vote
0answers
20 views

Magento 2 - Empty Cart and Quote behaviour

When the session quote has no visible items should it be set as inactive or still kept as active? Does anyone know how to do it? Thanks in advance.
1
vote
1answer
394 views

Customer session loggedIn() not working Magento 2

I have to check whether a customer is logged in or not. It only works for My account page and for the rest of the pages, it gives a null result. It was working before. $objectManager = \Magento\...
1
vote
0answers
322 views

How to get custom session in rest api calls?

I have created a custom session and it's storage with custom namespace. I have set some data in storage which I am trying to fetch in my api calls but not getting any data in session. I do get the ...
1
vote
0answers
385 views

Warning: session_regenerate_id(): Session object destruction failed. on Magento 2 Checkout

I have a Magento 2.2.4 running on a Windows IIS server. When entering checkout, I often get There has been an error processing your request error. When I check the error report, it says * ...
1
vote
0answers
41 views

Magento 1.9.4.0 order not creating

I have been working on integration of a payment gateway with Magento 1.9.4.0 it works perfectly and the orders are being created successfully. However, there is a case when the user tries to login ...