antonioribeiro / tracker

Laravel Stats Tracker
MIT License
2.89k stars 594 forks source link

Using my own cookies #306

Open aliajoudanian opened 7 years ago

aliajoudanian commented 7 years ago

I automatically generate the specific cookie for visitors. Even after setting up the name of the cookie in config.php & tracker.php, I'm not able to store the value of my cookie in user's browser and It uses default Tracker cookie model. How can I store my own cookie value?

mohabhassan commented 7 years ago

You can't ? Tracker uses php's function session_start() while the function used to change the cookie name session_name() if you can implement it and pull request would be awesome,

antonioribeiro commented 7 years ago

@mohabhassan, we would have to take a better look to that now. Tracker is only using PHP native sessions because Laravel, at the time, was dropping sessions and creating new ones "too frequently", is it still doing this? I'm not sure. For instance, after login you get a new session ID or Laravel keeps the old one?

mohabhassan commented 7 years ago

I don't know tbh, but since laravel 4.2 multiple session drivers exist, https://laravel.com/docs/5.4/session#introduction Cookie session is there too, these option exist in config/session.php too:

/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/

'lifetime' => env('SESSION_LIFETIME',120),

'expire_on_close' => false,
mohabhassan commented 7 years ago

This would need further research.