How to automatically log out if the user is idle for a certain period of time on yii2How to get users of a specefic role in Yii2 and DbManager?How to automatically delete file from runtime in Yii2 that isn't being used for current runtime?Can we use varnish cache with YII2Trying to migrate SQL commands from plain PHP using Yii2How to Insert data automatically in Yii2?How to change current user in Yii2How to refresh kartik grid view periodically in yii2Override User afterLogin MethodAutomatic Logout after 5 minutes of inactive in yii2How to change language automatically using user browser language Yii2?

Why isn't there research to build a standard lunar, or Martian mobility platform?

US Civil War story: man hanged from a bridge

Can a Beast Master ranger have its beast chase down and attack enemies?

How to ask for a LinkedIn endorsement?

Are neural networks prone to catastrophic forgetting?

Why weren't bootable game disks ever common on the IBM PC?

Why are Hobbits so fond of mushrooms?

Why did Harry Potter get a bedroom?

Using Newton's shell theorem to accelerate a spaceship

Why can a destructor change the state of a constant object?

If a non-friend comes across my Steam Wishlist, how easily can he gift me one of the games?

Integer Lists of Noah

QGIS Zanzibar how to crop?

Do you know your 'KVZ's?

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

What is this triple-transistor arrangement called?

Why are all my yellow 2V/20mA LEDs burning out with 330k Ohm resistor?

Why isn't pressure filtration popular compared to vacuum filtration?

Received a dinner invitation through my employer's email, is it ok to attend?

Why do players in the past play much longer tournaments than today's top players?

How would my creatures handle groups without a strong concept of numbers?

Can fluent English speakers distinguish “steel”, “still” and “steal”?

Why doesn't sea level show seasonality?

Cops: The Hidden OEIS Substring



How to automatically log out if the user is idle for a certain period of time on yii2


How to get users of a specefic role in Yii2 and DbManager?How to automatically delete file from runtime in Yii2 that isn't being used for current runtime?Can we use varnish cache with YII2Trying to migrate SQL commands from plain PHP using Yii2How to Insert data automatically in Yii2?How to change current user in Yii2How to refresh kartik grid view periodically in yii2Override User afterLogin MethodAutomatic Logout after 5 minutes of inactive in yii2How to change language automatically using user browser language Yii2?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have given the task to introduce automatically logout feature in the webstie using Yii2 framework. I am new, please if anyone can guide me










share|improve this question

















  • 1





    add your config, this should be the default behavior but you need to add the config file

    – Muhammad Omer Aslam
    Mar 26 at 15:08


















1















I have given the task to introduce automatically logout feature in the webstie using Yii2 framework. I am new, please if anyone can guide me










share|improve this question

















  • 1





    add your config, this should be the default behavior but you need to add the config file

    – Muhammad Omer Aslam
    Mar 26 at 15:08














1












1








1








I have given the task to introduce automatically logout feature in the webstie using Yii2 framework. I am new, please if anyone can guide me










share|improve this question














I have given the task to introduce automatically logout feature in the webstie using Yii2 framework. I am new, please if anyone can guide me







yii2






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 1:59









SibghatSibghat

32 bronze badges




32 bronze badges







  • 1





    add your config, this should be the default behavior but you need to add the config file

    – Muhammad Omer Aslam
    Mar 26 at 15:08













  • 1





    add your config, this should be the default behavior but you need to add the config file

    – Muhammad Omer Aslam
    Mar 26 at 15:08








1




1





add your config, this should be the default behavior but you need to add the config file

– Muhammad Omer Aslam
Mar 26 at 15:08






add your config, this should be the default behavior but you need to add the config file

– Muhammad Omer Aslam
Mar 26 at 15:08













1 Answer
1






active

oldest

votes


















0














You can set authTimeout property in user components config



'user' => [
'class' => 'yiiwebUser',
'authTimeout' => 3600
],


above code will automatically logout user after 1 hour.






share|improve this answer























  • Thank you for the reply

    – Sibghat
    Apr 22 at 4:10










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348807%2fhow-to-automatically-log-out-if-the-user-is-idle-for-a-certain-period-of-time-on%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You can set authTimeout property in user components config



'user' => [
'class' => 'yiiwebUser',
'authTimeout' => 3600
],


above code will automatically logout user after 1 hour.






share|improve this answer























  • Thank you for the reply

    – Sibghat
    Apr 22 at 4:10















0














You can set authTimeout property in user components config



'user' => [
'class' => 'yiiwebUser',
'authTimeout' => 3600
],


above code will automatically logout user after 1 hour.






share|improve this answer























  • Thank you for the reply

    – Sibghat
    Apr 22 at 4:10













0












0








0







You can set authTimeout property in user components config



'user' => [
'class' => 'yiiwebUser',
'authTimeout' => 3600
],


above code will automatically logout user after 1 hour.






share|improve this answer













You can set authTimeout property in user components config



'user' => [
'class' => 'yiiwebUser',
'authTimeout' => 3600
],


above code will automatically logout user after 1 hour.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 1 at 15:32









Ava DarabiAva Darabi

634 bronze badges




634 bronze badges












  • Thank you for the reply

    – Sibghat
    Apr 22 at 4:10

















  • Thank you for the reply

    – Sibghat
    Apr 22 at 4:10
















Thank you for the reply

– Sibghat
Apr 22 at 4:10





Thank you for the reply

– Sibghat
Apr 22 at 4:10








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348807%2fhow-to-automatically-log-out-if-the-user-is-idle-for-a-certain-period-of-time-on%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript