vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Forcing redirect leads to token error (https://vborg.vbsupport.ru/showthread.php?t=281349)

joshtrav 04-10-2012 05:13 AM

Forcing redirect leads to token error
 
I am currently trying to redirect from page A to page B based if post data sent to page B is incorrect.

Using the method
Code:

header('Location: http://www.website.com/pageA.php');
Brings me to the following error:
Code:

Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.

I am also sending post data back to the page A to identify the mistakes.

Does anyone have any idea how I can achieve this as the above method seems invalid?

LifesGreatestGift 04-10-2012 05:21 AM

wrap it in ob_start(); ob_end_flush(); ?

joshtrav 04-10-2012 05:45 AM

Tried that as well.

I found that it has to do with the CSRF protection being defined to true on PAGE B. I tried sending the hash and security token in the form as hidden with:

Code:

<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />

And that did not help. I am at a loss.

--------------- Added [DATE]1334041500[/DATE] at [TIME]1334041500[/TIME] ---------------

Sigh, its getting late and I am just not thinking things through.

I forgot to alter the values for the change in how vb4 handles the variables.

Code:

<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />

Fixes the issue.

LifesGreatestGift 04-10-2012 10:28 PM

lol, that will do it. :) glad you got it resolved. Next time post the code so we can save you the headache ;)


All times are GMT. The time now is 02:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00984 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete