John Davidson

php - Why does my Symfony native Session change?

0 comments
Message:


I'm using Symfony Session component with NativeStorage.
The initialization is very simple (session property has type Symfony\Component\HttpFoundation\Session\Session)


$this->session->start();

I'm facing a session issue during payment redirects, my application redirects user to Paypal payment, if the user push "abort" link in Paypal page it will be redirected to the abort page of the initial application.


During this second redirect somehow the session is refreshed and a new cookie and a session-id is activated.


I'm working with Firefox without private mode. I have tried to open the page manually in a new browser tab but the session is discarded in the same way.


What can cause a session expiration during a page redirect? The cookie generated is the standard cookie made by Symfony Session class and PHP:



Domain and protocol (https) dont change. The URL path changes from initial page to abort page.


UPDATE:


The issue seems to be connected to Firefox.
I have tested it with Chrome and works, I have tested the case with Firefox in privacy mode and it works... so I guess it is something wrong with my firefox sessions.



My Answer:
>session = new Session(new NativeSessionStorage());_However, when I set a value in the session like this:_$this->session->set('key', 'value');_and then later retrieve it like this:_$value = $this->session->get('key');_I find that the value has changed or is not the same as what I originally set._What could be causing this issue?

Rate this post

3 of 5 based on 5735 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us