Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DDSameera's avatar

Laravel Session Related Question

Hey ! genius. this is really big doubt for me. please help me to resolve this .

Think, i need to save "INVOICE_ID" in laravel session .so i m going to use Laravel session . after that i will add that invoice_id variable in to that session .

After that , I will access that variable in several pages . When user logged out from the system . every sessions will clear.

Here is my question. if he/she open several tabs and access different invoices , then system will keep several invoice numbers in session. Am i right ? If NO, please explain it.

Screens https://snipboard.io/qpXLaE.jpg https://snipboard.io/3ZoahR.jpg

0 likes
4 replies
jlrdw's avatar
jlrdw
Best Answer
Level 75

Each invoice will have its own invoice number or id number. So session should be fine, or use session array.

I normally just do some trial and error work first to see what works.

2 likes
Snapey's avatar

Answer is wrong. All tabs will share the same session

1 like
Snapey's avatar

its a fact. If you duplicate a tab then you are also logged in on that second tab, yes? That is because the tabs share the same session.

Use laravel debugbar to review what is in session

Please or to participate in this conversation.