Support the ongoing development of Laravel.io →
posted 8 years ago
Session

Hi everyone please i want to know how to set a session and use it in my website using laravel

in normal php file without laravel i made $_SESSION['job_type']=1;

and in 4 pages i made if($_SESSION['job_type']==1) { // do something here}

i want to make like this in laravel and tried many times but i can not make it

any idea

Last updated 3 years ago.
0
\Session::put('job_type', 1);

if(\Session::get('job_type') == 1) {
{
    //do something
}

https://laravel.com/docs/5.3/session

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.