Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [session]

Denotes questions about session management in Magento.

0
votes
0answers
13 views

How to render login error message in product page?

If a user tries to login with wrong credentials then normally a message appears which says "login failed", it works if I do it on the normal login form at /customer/account/login/ But if I am at a ...
0
votes
0answers
11 views

Magento 2: What is the best practice of storing and retrieving custom data

Looking for some input on what the best practice would be to store and retrieve custom data. As an example, I need to store, retrieve and update a couple of custom variables: access_token and ...
0
votes
1answer
17 views

Magento 2.2.x: Persistent Checkout can't be disabled

The problem is even when i disable the "persistent checkout", it still work as normal. Its a magento default module, so i think this is a magento 2 bug. After a day working on this, i still don't ...
1
vote
1answer
22 views

How to fix session error in magento 2.3.0

How to fix error "Your session has expired"
1
vote
1answer
13 views

Customer Session Delay

I have a .phtml file that loops through dropdowns. There are 6 dropdowns belonging to two different groups (so 3 dropdowns per group). I set a session on button click: if ($this->getRequest()->...
0
votes
0answers
14 views

Login session does not work

I am trying to use login session on magento/catalog/view/base/templates/product/price/amount/default.phtml to hide price from users not logged in. However, it seems not working well with $...
0
votes
1answer
22 views

Magento2- Session Empty After Being Set

I have some code that, when a button is clicked, sets a session value to 1. Then (in the same frontend place) checks that value and if present, do something else. This is my Controller (skimmed to ...
0
votes
0answers
14 views

ASV scan failing because of Session ID in URL

We're on a Magento 1.9.3.7 and our Aperia ASV scan is failing because of Session ID in URL. One example would be the following https://mystore.com/category.html?SID=rmdfi0m0gibepot9eom7egj384 Payload:...
1
vote
0answers
22 views

Why reset the customer session data when FPC is enabled?

Regarding this article from @SohelRana what is the business or technical decision to empty the customer session data when FPC is enable?
0
votes
0answers
18 views

In Magento 1.9, how to access session id on the client side using javascript?

According to the following 2 answer, PHP session id is stored on the client side and with each request, the session id is sent to the server which is what helps the server in identifying the client. ...
0
votes
0answers
21 views

Magento throws a report error when customer session expires and shopping cart persistent is active

So recently I experienced a different issue in Magento 2.2.5, related to the shopping cart persistent. Basically what happens is when a customer is logged in with a product in the cart, and this ...
0
votes
0answers
26 views

How to solve session_generate_id exception in magento2?

Getting error 1 exception(s): Exception #0 (Exception): Warning: session_regenerate_id(): Session object destruction failed. ID: user (path: D:\Projects\xampp\tmp) in \vendor\magento\framework\...
0
votes
1answer
39 views

How to use session data in view (phtml) magento 2

i can access session data in my controller using \Magento\Framework\Session\SessionManagerInterface public function __construct( Context $context, PageFactory $resultPageFactory, ...
0
votes
2answers
30 views

Problem Sessions Database - Magento 2

today I saw my Magento database and in a few months it went from a weight of 300MB to 2GB. I saw which of the tables was heavier and I saw that there is a 2GB SESSION table. Why do the sessions are ...
-1
votes
0answers
15 views

Magento 2.2 : Session-based authentication not working

If I want to access: https://www.myshop.com/rest/V1/customers/me I have an empty response 'not authorized to access' ... If I first login as a customer and access the same page, it should give me ...
0
votes
0answers
78 views

Magento 2 Session issue

I have moved my Magento code base to another folder and I have upgraded the php version to php7. Now I am facing the following error. SessionHandler::read(): Session data file is not created by ...
0
votes
0answers
25 views

Does Magento 2 ever clean up it's own old sessions?

We currently have a production site with 4.2 GB of session data, dispersed over 2.8 million records. Some of these sessions are more than 1,5 year old! I was always in the assumption that Magento ...
1
vote
1answer
181 views

Magento 1 session in database error with PHP 7.2

Updated to Magento 1.9.3.10 with PHP 7.2. If I save the sessions in db: <session_save><![CDATA[db]]></session_save> I get this error: Recoverable Error: session_module_name(): ...
0
votes
0answers
54 views

Redis session configuration breaks web setup page

I have an issue when it comes to using Redis as session cache. If I use Redis for session caching, I lose the ability to go /setup page. When I remove Redis related code, the page loads just fine. I'...
0
votes
1answer
12 views

Acquire session of logged in customer in external script

I was trying to acquire session of logged in customer in one of external PHP script in the same folder as my Magento installation: <?php require_once 'app/Mage.php'; umask(0); Mage::app(); $...
0
votes
1answer
114 views

Magento 2: Multi website session issue

I am a beginner to magento and I have created a magento 2 multi-website and the URL looks like http://127.0.0.1/testproject/ and http://127.0.0.1/testproject/test. On these websites, while I have ...
1
vote
2answers
52 views

Magento 1.9.3.2 - Exception printing is disabled by default for security reasons

I have just moved a Magento install from one server to another and now when I try to access the frontend I get the "Exception printing is disabled by default for security reasons" error. I have ...
0
votes
1answer
13 views

Detect “was previous page from the same magento website?” If yes: then dont show APP notice

We have an APP popup that popups in mobiles. It depends on a meta param in the header. We would like to create an if / else scheme like if new visitor: print the meta param else (if not new and ...
0
votes
1answer
48 views

How to fix "Direct use of $_SERVER Superglobal detected' in Magento 1

Using the $_SERVER super global in an extension causes the following guideline error Direct use of $_SERVER Superglobal detected I know the alternative for Magento 2 but how do you solve this for ...
0
votes
2answers
112 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/...
2
votes
1answer
74 views

Get Error SessionHandler::read() When installing Magento 2 with Nginx

I downloaded magento 2.2.5 and try installing with nginx server, but I got blank page in the installation and then I saw the this error in the report file : {"0":"Warning: SessionHandler::read(): ...
0
votes
3answers
85 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
0answers
24 views

Admin login as vendor by using adminhtml session in marketplace system - magento 1?

Requirement: In marketplace system, Admin can login as vendor. I am not allowed to use param to add $vendorId into URL. I created admin controller to set $vendorId into admin session Mage::...
3
votes
3answers
39 views

Magento 2 - Check if user is loggen in header.html [duplicate]

I'm trying to create a piece of code to check if the customer is loggen in or not. I read not to use the objectmanager for that, but I don't know where to put which code. What I need: if customer is ...
0
votes
1answer
50 views

Session not getting value from phtml to block class magento 2

Value get back from session. did'nt get values please someone review my code. need help Here's my code: /home1/dukaania/public_html/testing2/app/code/Sugarcode/Test/Model/Total/Fee.php <?php /** ...
0
votes
1answer
35 views

getvalue() error field not get values

Fields not getting values in return array. $0.00 Please, someone, review my code. public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $...
1
vote
3answers
159 views

How can I set a global variable in Magento 2?

The scenario is I want to set my variable to a global variable from a phtml file and call in a module file or block file. So what would be some code or tutorial link that I set my variable to global ...
1
vote
2answers
56 views

How to destroy specific backend session programmatically

I am doing login and logout to magento backend via API. I am enable to create the session and pass to API response to my UI part. But when I log out from UI , the API should destroy that backend ...
0
votes
0answers
9 views

Does magento end a session when user password is reset?

Does magento end a session when user password is reset? If person A is logged in to magento and person B is logged in with the same account (at the same time), and then person A changes the password,...
2
votes
1answer
29 views

502 when customer signed in but not in customer account section

Using Redis and Cm_RedisSession module to store sessions, I'm seeing a 502 Bad Gateway error when a customer is signed in (but not when they are in the customer account section). The php error was ...
0
votes
1answer
192 views

How to set session variable

I need to set a variable session in Magento, do I do just procedural PHP or is there a proper way in Magento 2 ? Example : $_SESSION['myKey'] = "00001"; @AnsarHunsain code help me, but I can't get ...
1
vote
1answer
127 views

Magento 2 | Should “Guest” customer have a session ID?

I am trying to find out the session Id number. I am using object manager for this (temporarily): <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $...
4
votes
1answer
375 views

Magento 2 | Mini Cart has items but cart is empty | Session problem? | Double clicking on “Proceed To Checkout” redirects to an empty cart

I have a weird problem where my mini-cart is showing that there are products in the cart, however, cart is showing empty. Also, when refreshing the checkout a few times, it redirects to the cart with ...
0
votes
2answers
454 views

User already has more than 'max_user_connections

Yesterday I get issue : [2018-09-09 13:04:02] main.CRITICAL: SQLSTATE[HY000] [1203] User user_database already has more than 'max_user_connections' active connections {"exception":"[object] (...
3
votes
1answer
101 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, ...
2
votes
2answers
115 views

How to get customer session on category pages in Magento 2

Customer details are available only on customer page and checkout page. It must be a duplicate task but can someone tell how can we retrieve customer session on category pages. $context = $om->...
1
vote
0answers
232 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 ...
1
vote
0answers
50 views

Delete Session Files and Prevent Returning

I've already attempted to delete session files, but they come back one at a time and slowly... Huh? Can someone explain why please and help me permanently delete them please? I can not locate them in ...
1
vote
0answers
119 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,...
1
vote
1answer
405 views

mage-cache-storage clean after reload page magento 2.1 checkout

I input some information at the checkout. It write in mage-cache-storage. When I reload checkout page mage-cache-storage are clearing. Why is this happening? How I can fix it? Thanks in advance. I ...
1
vote
0answers
42 views

Global Page Success / Warning / Error Messages not showing in Admin

None of the global page messages are appearing on any page in the admin panel. This includes and is not limited to my own custom messages, saving a product, canceling an order and clearing the cache. ...
0
votes
2answers
188 views

Magento2 Check if Customer is logged in - Not working

I have taken the reference from this link Created the variable protected $_customerSession; Done the injection \Magento\Customer\Model\Session $customerSession, But in my Function in my block class ...
1
vote
0answers
52 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 ...
0
votes
1answer
275 views

how to set no-cache HTTP headers in controller in magento 2

I have read in Magento 2 Dev Docs for Public content we can set no-cache HTTP headers for Controllers that don’t use layouts(last line in page). Controllers that don’t use layouts should set no-...
1
vote
0answers
34 views

Magento Quote Duplicate value coming

I just need to find the categories of item in cart. For that I've used: class MageCustom_ShippingFilter_Model_Shipping extends Mage_Shipping_Model_Shipping { public function collectCarrierRates($...