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 8524075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:35:18+00:00 2026-06-11T07:35:18+00:00

i want to redirect from action a to action b in the same module.

  • 0

i want to redirect from action a to action b in the same module. Action b requires csrf token to execute, and i need to pass it a few parameters as well.

action a:

public function executeA(sfWebRequest $request){

   //... do stuff

   $this->redirect('module/b?id='.$something->getId());

}

action b:

public function executeB(sfWebRequest $request){

   $request->checkCSRFProtection(); //morte

   $something_id = $request->getParameter('id');
   //... do stuff

}

the action b executes, only if clicked on anchor created by link_to('module/b?id='.$something.getId() , array('method' => 'post')) or any other method, because it sends csrf token with the request.

i tried $this->forward() and $this->redirect() methods, and tried to add 'method' => 'post' to redirect params like in link_to() , but nothing works, and i cant find anything about it on the web either. API documentation says noting about it. all i get is

 500 | Internal Server Error | sfValidatorErrorSchema
_csrf_token [Required.]

error. it fails on the line marked //morte. please, does anyone know, how to do this properly, and also in cases that i want to redirect to other module?

  • 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-11T07:35:20+00:00Added an answer on June 11, 2026 at 7:35 am

    Ok this more clear now.

    The fact is the _csrf_token isn’t redirect to the other action, I mean, you didn’t re-add it in the query.

    Try:

    public function executeA(sfWebRequest $request){
    
       //... do stuff
    
       $this->redirect('module/b?id='.$something->getId().'?_csrf_token='.$request->getParameter('_csrf_token'));
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to redirect from an action in one controller to an action in
Iam working on Ubuntu.(Linux) I want to redirect from the page one.php to two.php,
I want to 301 redirect from: www.olddomain.com to the root of newdomain.com but I
I'm using Mod Rewrite for IIS 7.0 from iis.net and want to redirect requests:
From a Console Application project in Visual Studio , I want to redirect Console
I want to make my php page only accessible from another page redirect and
I want to redirect using .htaccess abc.com/test.php to abc.com/test . but it will execute/display
I want to redirect from one page to another page in ASP.NET MVC 3.0
I want to redirect from a link in a JSF page, how can I
I am using struts2 (2.1.6) and want to redirect to Action2 from Action1 .

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.