cookies setup
Moderator: General Moderators
Hi ,
Parse Error?
In few browsers , i didn't get problem with cookies.....
Please try in your system.... Please click once http://www.searchchips.com
username : catherine
password:catherine
afterthat please close the browser .... It shuoldn't ask the username and password..
Parse Error?
In few browsers , i didn't get problem with cookies.....
Please try in your system.... Please click once http://www.searchchips.com
username : catherine
password:catherine
afterthat please close the browser .... It shuoldn't ask the username and password..
Hi ,
I changed like this :::
setcookie ("member_id", "$id", time()+3600000,"/","lotofcontent.com");
My website is http://www.lotofcontent.com/searchchipsnew/
Still getting problem
I changed like this :::
setcookie ("member_id", "$id", time()+3600000,"/","lotofcontent.com");
My website is http://www.lotofcontent.com/searchchipsnew/
Still getting problem
http://www.lotsofcontent.com/searchchipsnew/test.php
just you will observe this one..... just see :HTTP_COOKIE value
just you will observe this one..... just see :HTTP_COOKIE value
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
searchchips.com:
lotsofcontent.com/searchchipsnew/index.php:
only a session cookie is set on your main page.
you have some form of errors in your setcookie call..
Code: Select all
HTTP/1.1 200 OK
Date: Fri, 20 Aug 2004 07:48:56 GMT
Server: Apache/1.3.31 (Unix) mod_pointer/0.8 PHP/4.3.2
X-Powered-By: PHP/4.3.2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/htmlCode: Select all
HTTP/1.1 200 OK
Date: Fri, 20 Aug 2004 07:49:49 GMT
Server: Apache/1.3.31 (Unix) FrontPage/5.0.2.2634
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Set-Cookie: PHPSESSID=3cf0a304db0e3e1e421b7129f0bb075d; path=/
Connection: close
Transfer-Encoding: chunked
Content-Type: text/htmlyou have some form of errors in your setcookie call..
Setting the cookies always worked fine. But if you've used sessions you'll find that when removing the cookie (logging out etc) the session id still remains in the cookie even after session_destroy(). session_destroy() doesn't remove the session id from the cookie. When removing sessions also do setcookie(session_name(),"",0,"/");
http://www.php.net/manual/en/function.s ... estroy.php
http://www.php.net/manual/en/function.s ... estroy.php
feyd | Please use
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi ,
Here i am posting my code....please review once..Code: Select all
<?
session_start();
//**************************************************************
// Main page --- This is base-one of all operations
//**************************************************************
//app.php file consists ------ Database connection and all variables.
include("lib/app.php");
//include all class files
include("classes/member.class.php");
include("classes/Memberchips.class.php");
include("classes/searchchips_codes.class.php");
include("classes/searchchips_membercodes.class.php");
switch($action){
case 'login':
$objmember->loadMultiple("member_name='$member_name' and password='$password'");
if(count($objmember->searchResults)){
$id=$objmember->searchResults[0]['member_id'];
setcookie ("member_id", "$id", time()+36000000,"/","$HTTP_HOST");
$first_name=$objmember->searchResults[0]['first_name'];
$last_name=$objmember->searchResults[0]['last_name'];
$chips=$objmember->loadchips($id);
$back_id=$id;
$objmemberchips->loadMultiple("member_id=".$id ." and type_chips='home-page'");
$_SESSION['home_page']=$objmemberchips->searchResults[0]['chips'];
$objmemberchips->searchResults[0]['chips']="";
$objmemberchips->loadMultiple("member_id=".$id." and type_chips='book-page'");
$_SESSION['book_homepage']=$objmemberchips->searchResults[1]['chips'];
$packid=1;
include("member-home.php");
}
else{
$msg="Invalid Username/Password !!";
include("home.php");
}
break;
default:
if($_COOKIE["member_id"]){
$res=$objmember->loadSingle($_COOKIE["member_id"]);
$first_name=$res['first_name'];
$last_name=$res['last_name'];
$chips=$objmember->loadchips($_COOKIE["member_id"]);
checklinks();
include("member-home.php");
}
else{
include("home.php");
}
break;
}feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Hi ,
I wrote sample file for cookie testing ....It's working fine.......http://www.lotsofcontent.com/searchchipsnew/sample.php
But In my site it is not working ....http://www.lotsofcontent.com/searchchipsnew/
So problem in my file only...........
Thanks,
Krishna
I wrote sample file for cookie testing ....It's working fine.......http://www.lotsofcontent.com/searchchipsnew/sample.php
But In my site it is not working ....http://www.lotsofcontent.com/searchchipsnew/
So problem in my file only...........
Thanks,
Krishna