Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8816467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:37:42+00:00 2026-06-14T04:37:42+00:00

Im tying to use the command sequence: Yii::app()->user->setFlash(‘success’, Successful!); Yii::app()->user->logout(); $this->redirect(array(‘user/login’)); The user got

  • 0

Im tying to use the command sequence:

Yii::app()->user->setFlash('success', "Successful!");
Yii::app()->user->logout();
$this->redirect(array('user/login'));

The user got logged out and redirected, but the Setflash does not work.
I also tried to change the order of 2 frist commands, but got the same problem.
If I do not logout the user, the Setflash works fine.

How can I make both commands work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:37:43+00:00Added an answer on June 14, 2026 at 4:37 am

    Flash messages are stored in the session. Logging the user our destroys the user’s current session. Once session_destroy() is called, you must call session_start() again in order to generate a new session ID and have this work. Yii most likely does not do that.

    If it’s that important that you have a “Successful” message indicating that the logout worked – then redirect the user to a “logout successful” page. Alternatively, you can look into overriding the way Yii performs a logout – although I wouldn’t recommend it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to use facebook's api command users.getInfo to retrieve the user's (if exists)
I have a console command line app that use NHibernate . I am trying
Using SQL Server 2000 I am trying to use this command in Query Analyzer
I am trying to use the date command in Terminal on multiple Mac OS
I'm trying to use the post build command line to get my class library
I am trying to use a regular expression with grep command of Linux (^\s*\*\s*\[
I'm trying to use a shell script to start a command. I don't care
I'm trying to use getopts in bash to parse command line arguments, but I
Im trying to use the CrmSvcUtil with the following command: C:\TMP\sdk\microsoft.xrm\tools>crmsvcutil.exe /connectionString:Authentication Type=AD; Server=myip;
I'm trying to use Command.Prepare with a CommandType.Text query that has a single input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.