Questions tagged [session]

Denotes questions about session management in Magento.

192 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
594 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 ...
4
votes
1answer
105 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
523 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
99 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
53 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
0answers
203 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 ...
3
votes
1answer
354 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
277 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
811 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
213 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
862 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
728 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
93 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 ...
2
votes
0answers
56 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
31 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
185 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
542 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
312 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
2answers
439 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
28 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
209 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
431 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
205 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
843 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
89 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
173 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
756 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
195 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
11 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
30 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
31 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
341 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
35 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
24 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
20 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
18 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
238 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
193 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
269 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
40 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 ...
1
vote
0answers
176 views

Magento 2 Remove cart content when user log-out | Empty cart when logged back in

Correct me if I'm wrong, but completely removing the cart content on customer log-out is not native to Magento 2 is it? I read about the "Persistent cart" but it seems to work only for removing the ...
1
vote
1answer
46 views

how can we access customer session in checkout

I have one special field called some_id in customer data and I want to save the some_id and quote_id in database. I am using sales_quote_save_afterevent to save both ids. But my customer session is ...
1
vote
0answers
83 views

Set Lifetime Session but Around a Week Expired Session--AGAIN and AGAIN in Magento 2.2.4

i want to set lifetime session but after around 1 week session has expired session.gc_maxlifetime 31536000 and Adding admin/security/session lifetime to 31536000 in core_config_data but still ...
1
vote
1answer
81 views

Magento2.2.5 : How to maintain a session value in product detail page to custom controller page?

I implemented some custom options in the product pdp page. i.e, i have to engrave the product in frontend(eg.pendant FRONT SIDE) as well as the backend(eg.pendant BACK SIDE) without refreshing the ...
1
vote
0answers
51 views

How to pass SID to url?

I see here many questions how to remove SID. It seems this is not very rare. How that even happen? Even if php ini settings for session.use_trans_sid is true and Magento setting Use SID on Frontend ...