PHP Session when using desktop app

Posted by Jonathan on Stack Overflow See other posts from Stack Overflow or by Jonathan
Published on 2010-04-11T11:17:40Z Indexed on 2010/04/11 11:23 UTC
Read the original article Hit count: 487

Filed under:
|
|
|

In this question I asked how to POST to a php file form a vb.net app: http://stackoverflow.com/questions/2615335/post-to-webpage-in-vb-net-win-forms-desktop-not-asp-net So now I've logged in the user user by posting their username and password to the php file, the php file then does security/checks they exist/etc and if both username and password are correct is stores the user ID in a session variable.

Now if the vb.net app tries to download data off a page which needs the user to logged in, it checks this by doing:

if (!isset($_SESSION['uid'])) {
    header("Location: index.php");
}

However after having logged correctly in the app the session variable is not set. How does session work with a vb.net app like this?

When the user logs in successfully should I download the user id and keep it in the vb.net app and then post it to each page that requires authentication?

© Stack Overflow or respective owner

Related posts about php

Related posts about vb.net