tyler.brandt

Experience

160

0 Best Reply Awards

  • Member Since 4 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

16th June, 2017

tyler.brandt left a reply on Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

Just checked my routes/web.php file, and it doesn't have 'web' middleware listed anywhere, however we are using some of our own custom middlewares, so maybe those are including the web middleware?

My routeServiceProvider is declaring the middleware, this is where it is globally applied, correct?

Route::middleware('web')
         ->namespace($this->namespace)
         ->group(base_path('routes/web.php'));

What I have finally done to fix the issue is to remove that from the RouteServiceProvider, and add the following to my [email protected] function

$this->loadRoutesFrom(base_path().'/routes/web.php');

And now my session variables are persisting

tyler.brandt left a reply on Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

Here is the content produced from Config::get(session)

array:14 [▼
  "driver" => "file"
  "lifetime" => 12000
  "expire_on_close" => false
  "encrypt" => false
  "files" => "/home/vagrant/Code/my_application/storage/framework/sessions"
  "connection" => null
  "table" => "sessions"
  "store" => null
  "lottery" => array:2 [▼
    0 => 2
    1 => 100
  ]
  "cookie" => "laravel_session"
  "path" => "/"
  "domain" => null
  "secure" => false
  "http_only" => true
]

tyler.brandt left a reply on Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

My login persists between pages without any issues. I just tested with the framework/sessions folder, and it appears to be acting strangely.

When I visit the login page, a new file is created. When I click 'login', one more file is created, and then one more when the landing page is loaded. Any time that I visit another page in the application, either one or three more files are created, depending on the page.

15th June, 2017

tyler.brandt left a reply on Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

Hmm, I don't see anything about the SESSION_DOMAIN setting in the docs, maybe I'm just missing it? Otherwise could someone shed some light on this?

tyler.brandt left a reply on Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

'domain' => env('SESSION_DOMAIN', null),

And I don't have an environment variable set up for SESSION_DOMAIN, so it is null

tyler.brandt left a reply on Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

update: I tried doing this instead:

session()->put('message', 'test message');
dd(session()->all());

And it worked when these two calls were right next to each other. However, I would actually like to set a session variable in a controller function before returning a redirect to another route, and then be able to see the variable at that point, but I cannot. Should I be able to see the variable at that point?

tyler.brandt started a new conversation Unable To Set Session Variables After Upgrading To 5.4 • 1 week ago

Hi, so we recently upgraded Laravel from 5.1 to 5.4, I wasn't involved in the update but I'm going through now trying to fix anything that may not be working after the change.

I noticed that our session flash messages don't show up upon login/other tasks, and I figured out that our session variables aren't getting set. I checked to ensure that we were using Session::put() instead of set(), and we are indeed using Session::put(). I have also tried the session('key', $value) method with no luck.

I literally have this code in my controller right now:

session('message', 'test message'); dd(session()->all());

And there is no 'message' variable dumped out at all. Any ideas as to what might be going on? All help is greatly appreciated.

1st February, 2017

tyler.brandt started a new conversation Uploading A File To A Laravel POST Route Through My C# Desktop Application And I'm Getting CSRF Mismatch Errors • 4 months ago

Hi, the title pretty much sums up what I'm trying to do. The function in Laravel that is attached to my POST route does some basic processing that I want to keep out of my desktop application (one part of which is choosing a new file name), and should return the file name that it will be stored under on the server. The problem is that every time I try to do a POST from my C# application it returns a CSRF token exception. Is there any way around this? The C# application wouldn't have gotten a token in the first place, since there is no web session, just a file upload to a function in Laravel. Is there something obvious that I'm overlooking? I am familiar with using CSRF tokens in my web forms in blade template files, but I have never tried to get a C# application to talk to Laravel.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.