-1

Im currently coding a basic login using HttpWebRequests in Visual Basic 2010. After following some tutorials, I somehow racked this code up: http://pastebin.com/azZuyvDM

Pretty much I have phpBB being hosted on my computer (using WAMP) and im using simple web requests to get this going. Now a common thing that Ive seen being asked, but not answered much (or maybe thats just me) is that sessions/cookies dont carry from page to page.

In this code, Button1 will do the actual logging in with the username and password. I put a WebBrowser just to see what happens so when I click Button2, it shows me the page of whatever happened during that HttpWebRequest.

What Ive noticed is that it does successfully log in but when it redirects back to the homepage, im no longer signed in. I need to be able to fix that.

If it helps, here is my actual project: http://bit.ly/10zFuHs

Hope I can get this annoying problem fixed. Thanks!

Steve Laster
  • 93
  • 1
  • 2
  • 5
  • Please post full urls in your question, this isn't Twitter, so size doesn't matter, and some people won't click on a shortened link. – FireCrakcer37 May 18 '13 at 19:37

1 Answers1

0

The user login_box

function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)

The auth login within that function

$result = $auth->login($username, $password, $autologin, $viewonline, $admin);

Only need to send those details to ucp.php.

So change

"username=test1234&password=test1234&redirect=.%2Fucp.php%3Fmode%3Dlogin&sid=8647eb7329cca5f50e0223716ad03de8&redirect=index.php&login=Login"

to

"mode=login&username=test1234&password=test1234&autologin=1&login=login"

Damien Keitel
  • 786
  • 1
  • 5
  • 12