Questions tagged [customer-session]

Denotes questions regarding Magento customer session.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

how we can put restriction on the customer reviews on the Magento

How I can put restrictions for customers in the review section. Only those customers can put review who are bought our products. Thank you
0
votes
0answers
13 views

Custom tab with session protection in magento 2

I have created a new tab in my account page. customer_account.xml page as below, <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
0
votes
0answers
15 views

Showing welcome text is wrong when switch websites - related to Session

Enviroment: Magento version 2.4.1 PHP 7.4 MariaDB 10.0.26 Setting: The website has multiple websites (2 websites) Login into Dashboard -> setting Account Sharing Options is Per websites ...
0
votes
0answers
15 views

Frontend Customer Login - Invalid Form Key. Please refresh the page

We are having an issue with the frontend customer login, where the users can't login as this error pops up: I have checked online for this issue and have found mostly back-office login errors, in the ...
0
votes
1answer
20 views

how to get custom session in magento 2?

I have tried this but this is giving empty log file. What should I do to get output for this: public function isAdmin() { $writer = new \Zend\Log\Writer\Stream( BP . '/var/log/myfile.log' ); ...
0
votes
0answers
11 views

Magento 1 - Load Session By Session ID?

How do I correctly load a customer session by ID? Sometimes (sporadically), Magento 1 creates a new session when returning from Payment gateway. I want to update information to the customer' order ...
0
votes
2answers
43 views

Current user duration or current user page count in magento 2

I have a custom module . In my observer i have to know the current user duration & current user ip in fronted . So i write the code for user ip . Now if a user visit my website i want to get is ...
0
votes
1answer
49 views

Magento2 Session Logsout when a person gets back from Payment Gateway

I am facing a very weird Issue in my M2 Store, whenever a user gets back from payment gateway after successful transaction, user automatically logs out from the session and land back on cart page with ...
0
votes
0answers
37 views

Share login details on multiple websites in Magento 2

I have two websites on one Magento with two different domains. Now, when customers log in to one domain and they go to the rest domain, they must log in again. Is there any way to share log in, So, ...
0
votes
1answer
40 views

Customer session isLoggedIn() not working properly due to the Magento Cache

I am checking if customer is logged in or not(also i have to display customer name) but sometimes it's not working and after flushing block_html cache it works. I have tried all possible solutions:- ...
0
votes
0answers
20 views

Magento2 : Allow customer login only one device at a time

I want to allow customer to login in device one at a time.It should be similar to admin login functionality. If customer login to another device then from other device it should be logout. Let me ...
0
votes
1answer
124 views

Customer session issue for login users in magento1.9.4.4

I have problems with front end customer login, I have checked it with same system and login with two different different customer detail on to the different-2 browsers. On chrome I have login with ...
0
votes
0answers
6 views

Customer visit tracks in Headless setup

For every guest or customer visit Magento stores data in table customer_visitor after executing events controller_action_predispatch or controller_action_postdispatch. But we need to track the same ...
0
votes
0answers
44 views

Get error Guest checkout is disabled after ajax customer login Magento 2.3.3

I am facing the issue with "Guest checkout is disabled" error after the customer log in using Ajax call. Guest checkout is disabled due to the requirement. The below code will run on clicking by the "...
2
votes
1answer
558 views

Magento is losing customer session when returning from payment gateway

We have developed a payment plugin for Magento 2. The plugin is working correctly in our test environments and in some merchant environments but it's failing in some merchants stores due to not being ...
0
votes
0answers
11 views

how to set custom variable in session when customer log in and also use that value in minicart.js

I'm using magento 2.3 while customer log in ,custom variable set to customer session and use that custom session value in minicart.js file.
0
votes
0answers
60 views

Force customer logout from external process

I need to be able to force a logged in user to re-login based on an event that occurs in a background process. E.g. if the event occurs, I want the user to be redirected to the login page when they ...
0
votes
1answer
106 views

Magento 2.3.4 multi-store customer session transfer

I have installed Fresh Magento 2.3.4, and set multiple store with websites on sub-domains. I want customers to signin in one store and then automatically signedin on another store on sub-domain. I ...
0
votes
1answer
26 views

Magento2: How to get registered online customer only?

customer_list.phtml $om = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $om->create('Magento\Customer\Model\ResourceModel\Online\Grid\Collection'); $customerData = $...
0
votes
1answer
86 views

Store switcher gives 404 error with customer logged in and folder structure in Base URL

Did you ever face 404 Error when the customer is logged in and switching the store switch with having folder structure is Base Url? Something like, Base Url is http://examplemagento.com/b2c/ I have ...
0
votes
0answers
14 views

Keeps asking to login Magento 2.3.4

Not sure if this is a bug or if this is an actual issue which is going on. I have tried to read up on few informations and tried to follow the steps. But I am not getting anywhere unfortunately. The ...
0
votes
1answer
17 views

When transferring data through $customerSession, I receive data locally, but not on the production

I have a custom functionality for creating an order, I want to transfer the custom LastOrderId to the success page to which the user gets after submitting the form. The controller responsible for ...
0
votes
0answers
54 views

Customer validation called twice (Observable event re-execution)

I'm customizing customer_account_create. I need save taxvat as CPF/CNPJ (Brazilian attributes) so I need to validate it, then I created an observable in: etc/events.xml <?xml version="1.0"?> &...
0
votes
0answers
130 views

X-Magento-Vary Cookie getting lost

As the title says, the X-Magento-Vary cookie isn't working that well on my website. Sometimes, whenever a customer logs in, the cookie isn't created and that makes the user lose the session as soon as ...
0
votes
0answers
14 views

SOAP - customer logged in, but can't see cart

I use SOAP and the customer's email address to log the customer into the shop system. This is successful. If I now add a product to the customer's shopping cart via SOAP, it will be forwarded to the ...
0
votes
0answers
124 views

Session not set in PHPSESSID Cookie when FPC is enabled

I am trying to pro-grammatically log in using the SID. The front-end already shows me that I am logged in, but as soon as I go to a page that needs a logged in user (ex. account page) I am not ...
1
vote
1answer
451 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
12 views

Not get logged in chrome.302 status came

I am not able to login in Chrome but able to login Firefox,Internet Explorer.I have added session time 24hrs from admin settings.Also tried with core varient.php file session code commented, but no ...
1
vote
1answer
229 views

Magento 2 - Increase customer session timeout for inactivity

Customer gets logged out after 30 mins of inactivity. I want to increase it to 1 hour. Any idea how to that?
0
votes
4answers
56 views

Magento 2.3.2 How to redirect customer on login page if he hit custom customer dashboard link in browser without login?

I have created customer dashboard custom tab and the path is 'inquiry/customer/' which is working fine. Issue is that If the user hit the direct that url in the browser without login in his account ...
1
vote
0answers
18 views

How to conditional show content by customer group

I have a function to get the customer group ID and in my phtml file if it equals the customer group id I show content. The issue is that when I test it in a production environment the content doesn't ...
0
votes
1answer
52 views

How can I get all quote which is active with customer ID

Is there anyway I could print out in a table in phtml the following: Entity_id , is_active and store Is it possible to get all active quote within a customer_id? I want to show this in a table I ...
0
votes
2answers
362 views

how to change customer session data in Magento 2?

after customer login, I want to change some of the session params like customer name. I do like this $this->_customerSession->getCustomer()->setName("ddddddd"); also i tried this $this-&...
3
votes
0answers
127 views

How to retain customer login after switching website in Magento 2.3?

I have a website switcher button on my Magento 2.3 site (not a store switcher). When a customer logs in on the website - abc.magento.com, I programmatically switch the website to pqr.magento.com, it ...
1
vote
1answer
510 views

How to show Block depending on Customer Logged In/Out in Magento 2

I want to Show Conditionally Depend of customer logged in status For Magento 1 i Found this Solution i want Same Lopic for Magento 2 // is Logged in <customer_logged_in> <reference ...
0
votes
2answers
25 views

Trouble in getting in customer data using block class

I'm having trouble in getting the customer details using block class. I want to show the customer name after he/she logged in using block class. I can do it via object manager but not through block. ...
2
votes
2answers
171 views

Magento 2 : \Magento\Customer\Model\SessionFactory $customerSession is not working with FPC

If we need to get current customer sessions in a block, cacheable must be set to false in the layout XML. I am using \Magento\Customer\Model\SessionFactory $customerSession in my block but it is not ...
0
votes
1answer
146 views

How to get customer session data outside Magento

I want to know if it is possible to get customer session data outside of magento2 <?php error_reporting(E_ALL | E_STRICT); $mageFilename = 'app/Mage.php'; require_once $mageFilename; $app = Mage::...
0
votes
1answer
59 views

Magento2: Admin dashboard is suddenly logout some times

when I login to the admin dashboard, after some seconds admin is logged out and redirects to the login page. What is this issue?
3
votes
1answer
175 views

Session lifetime in magento2 frontend?

What is the maximum session life time for the frontend customers in magento2? Also, Is the session lifetime depends on session.gc_maxlifetime php variable? Any help please?
1
vote
1answer
190 views

Magento 2 : How to end all active sessions for a customer?

I was looking for possibility where i can give option to customer after password update to end all active sessions related to his account . It would be helpful if can point in direction (even with a ...
1
vote
0answers
169 views

Magento 2 TypeError: options is undefined in firefox

After working for few day I noticed that I am getting this issue in my Firefox and not in Chrome. TypeError: options is undefined If I do cache clean and check in Firefox it works for the first ...
0
votes
3answers
388 views

getting null in customer email Magento 2 Custmer session

Edit.php (block) class Edit extends \Magento\Framework\View\Element\Template { protected $request; protected $customerSession; public function __construct( \Magento\...
1
vote
2answers
81 views

M2 | How to Get Logged in customer ID in Model class?

I need customer ID in Model class as I am creating custom API. I can get customer ID in Controller as well as in Block class by all below ways: Injecting in constructor \Magento\Customer\Model\...
3
votes
0answers
241 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 ...
0
votes
1answer
212 views

Magento 2 : Separate home page for logged in and guest user [closed]

I want to show different home page for logged in user, Which event/plugin I can use for this ? Whenever logged in customer clicks on homepage he should be redirected to different url Logged-in user : ...
1
vote
2answers
425 views

How to get customer ID Magento 2.3.2

After logged in Magento frontend. I need to get ID of user on which account I am currently logged in. Please help.
1
vote
0answers
35 views

VAT Customer shipping goods to different country with billing address VAT magneto 2.2.3

Not sure how to get this working, if anyone has any idea will be appreciated for the time. My aim is to create a module to check if the customer passing two different countries in billing and ...
1
vote
0answers
44 views

Magento2 - Customer Session set one store to another store

Magento2 - I have setup 2 store like 1: default store view (home page) 2: English ( sub pages ) When I'm going to English store than login its working and get customer session but ...
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 ...

1
2 3 4 5