How to set Permanent Session for Token in Dreamfactory 2.2.0?

community

#1

I am building Rest Api and made changes in df.php file by setting

'allow_forever_sessions' => env('DF_ALLOW_FOREVER_SESSIONS', true) 

and also use “remember_me”:true in code for eg.
{
“id” : 5,
“email” : "Zxy@example.com",
“password” : “Zxy”,
“remember_me”:true

}
But, still facing token expiration issues. I want to make token life forever.
What can I do to make it alive ?.
Need help.

Thanks.


#2

I would recommend against changing df.php
System settings should be changed in the .env file
See http://wiki.dreamfactory.com/DreamFactory/Tutorials/Forever_sessions

After you make those changes, you may need to clear a cached configuration.

Backup the file bootstrap/cache/config.php; save it somewhere in case clearing the config cache causes problems.
Then run php artisan config:clear


#3

I made changes in df.php file but didn’t find .env file anywhere.
I am working on Dreamfactory-2.2.0.


#4

If this is a Bitnami install it will be in the htdocs folder.
For example, on Windows, this would default to C:\Bitnami\dreamfactory-2.2.0-0\apps\dreamfactory\htdocs\.env

Since the filename starts with a . it is likely hidden in your file browser. You will need to show hidden files to see it.


#5

But where .env file is located ?


#6

See the post right above yours


#7

I tried all the 3 steps that you have mentioned in the post but i am getting

"allow_forever_sessions:false" after calling GET:[http://127.0.0.1:81/api/v2/system/environment](http://127.0.0.1:81/api/v2/system/environment).

I am using Dreamfactory 2.9.0. Is that any issue with this version?

Please give me some help.