Jump to content

Copying a cookie to stay logged in


Torflu

Recommended Posts

Well I am trying to take a second approach,to stay logged in by copying the cookie.I am trying to scrape the news and mail it,for it i need to be logged in.My earlier thread's link - http://www.phpfreaks.com/forums/index.php/topic,262923.0.html.When i see my cookie details,using an addon in mozilla i see following details.

 

Name : pass
Value : 1223b8c30a347321299611f873b449ad
Domain/Path : www.xx.org/
Expires : Tuesday, January 19, 2038 7:44:33 AM

Name : uid
Value : 1028666
Domain/Path : www.xx.org/
Expires : Tuesday, January 19, 2038 7:44:33 AM

 

I am trying with the following code

 

<?
$value = "1223b8c30a347321299611f873b449ad";
$uid= "1028666";
setcookie("pass", $value, time()+3600*24*1000,"www.xx.org");
setcookie("uid", $uid, time()+3600*24*1000,"www.xx.org"); 
$open = file_get_contents('http://www.xx.org/browse.php');
echo $open;
?>

 

I am getting 2 errors

 

Warning: Cannot modify header information - headers already sent by (output started at C:\Users\Nuv\AppData\Roaming\NuSphere\PhpED\projects\pt.php5:2) in C:\Users\xx\AppData\Roaming\NuSphere\PhpED\projects\pt.php5 on line 5

Warning: Cannot modify header information - headers already sent by (output started at C:\Users\Nuv\AppData\Roaming\NuSphere\PhpED\projects\pt.php5:2) in C:\Users\xx\AppData\Roaming\NuSphere\PhpED\projects\pt.php5 on line 6

 

Can someone,please help me with my code and if it will work ?

Link to comment
https://forums.phpfreaks.com/topic/168363-copying-a-cookie-to-stay-logged-in/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.