Problema cookie o sesiones Wininet

Iniciado por Riki_89D, 1 Septiembre 2011, 16:25 PM

0 Miembros y 1 Visitante están viendo este tema.

Riki_89D

Hola que tal,por fin consegui iniciar sesion en este foro con wininet,el caso es que cuando posteo despues de hacerlo leo la pagina con InternetReadFile para ver si a ido bien,y me devuelve la pagina del formulario donde posetamos el mensaje con el boton "enviar",y arruiba hay un mensaje en rojo que dice que mi sesion a expirado,entonces yo queria preguntar como ago para que no expire la sesion?¿ se de InternetSetCookie y se usarlo pero nse como aplicarlo a esto,nose si me entienden.



gracias de antemano

Nadie puede ayudarme?¿

miren cuando intento postear leeo la pagina y me sale esto:



y antes ya e iniciado sesion,alguien sabe por que pasa?¿


les dejo el codigo por si acaso:

Código (cpp) [Seleccionar]

// VARIABLES


char *CabeceraWeb = "Content-Type: application/x-www-form-urlencoded";
char *Datos = "user=Nombre&passwrd=Contrase";
char *Men = "subject=Multiposter&message=Multiposteador de prueba&cookielength=90";
char BufferIn[90000*2];
DWORD BytesR;
DWORD Siz;
HINTERNET Query2;


HINTERNET Sesion1,Sesion2,Conexion1,Conexion2,Query1,Query2;
Sesion1 = InternetOpen("Mozilla/4.0",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);

Conexion1 = InternetConnect(Sesion1,"foro.elhacker.net",INTERNET_DEFAULT_HTTP_PORT,NULL,NULL,INTERNET_SERVICE_HTTP,0,1);
Query1 = HttpOpenRequest(Conexion1,"POST","/login2.html",NULL,NULL,NULL,INTERNET_FLAG_KEEP_CONNECTION&&INTERNET_FLAG_DONT_CACHE&&INTERNET_FLAG_NO_CACHE_WRITE,1);
HttpSendRequest(Query1,CabeceraWeb,strlen(CabeceraWeb),Datos,strlen(Datos));


Query2 = HttpOpenRequest(Conexion1,"POST","/post2.html;start=0;board=7",NULL,"foro.elhacker.net/login2.html",NULL,INTERNET_FLAG_KEEP_CONNECTION,1);
HttpSendRequest(Query2,CabeceraWeb,strlen(CabeceraWeb),Men,strlen(Men));

HANDLE FileRead = CreateFile("Web.html",GENERIC_READ|GENERIC_WRITE,FILE_SHARE_WRITE,0,CREATE_NEW,FILE_ATTRIBUTE_ARCHIVE,0);
while(InternetReadFile(Query2,(char*)BufferIn,90000*2,&BytesR))
{
if(BytesR == 0)
{
break;
}
WriteFile(FileRead,&BufferIn,sizeof(BufferIn),&Siz,NULL);
}




estoy desesperado ya :(