Ehesp / Steam-Login

A simple PHP Steam login and validation package
MIT License
44 stars 8 forks source link

Cant redirect with a message on laravel 4.2 #12

Closed ImChiip closed 8 years ago

ImChiip commented 8 years ago

Hi , Got a problem /w my app on laravel 4.2 Cant send a message with login redirect My controller

public function confirm(){
        if(Session::has('steam64')){
            return Redirect::to('profile')->with('message-error', 'Vous êtes déjà connecté');
        } else {
            if (empty($_GET)) {
                App::abort(403, 'Unauthorized');
            } else {
                $steamid64 = SteamLogin::validate();

                Session::put('steam64', $steamid64);
                Session::save();

                $datasteam = $this->dbRequest('players', $steamid64)

                return Redirect::to('profile')->with('message','Votre message a bien été envoyé');
            }
        }
    }

My index.blade.php

                @if(Session::has('message'))
                <div class="alert alert-success">
                    <p>{{Session::get('message');}}</p>
                </div>
                @endif

Return from var_dump on login

array(4) {
  ["_token"]=>
  string(40) "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ["flash"]=>
  array(2) {
    ["old"]=>
    array(0) {
    }
    ["new"]=>
    array(0) {
    }
  }
  ["steam64"]=>
  string(17) "XXXXXXXXXXXXXXXXXXXXXXXX"
}

if i remove

                $steamid64 = SteamLogin::validate();

                Session::put('steam64', $steamid64);
                Session::save();

its working any issue for that ? Sorry but im bad with english

Ehesp commented 8 years ago

Erm, haven't used Laravel in a while but I don't think this is a Steam Login issue.

Have you tried to remove Session::save();? I don't think you need it and could be causing issues.

ImChiip commented 8 years ago

its work if i write my steamid plain text

                $steamid64 = "mysteamid";
                Session::put('steam64', $steamid64);
                Session::save();

i see my session message

Ehesp commented 8 years ago

Can you var_dump the contents of $steamid64 before you save it to a session?

ImChiip commented 8 years ago

var_dump of $steamid64 = SteamLogin::validate(); return string(17) "7656119805334XXXX"