General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 21st, 2003, 01:19 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
cookie problem

Okay I am using the membership system that was put on devarticles a while back, the one that ben rowe wrote. But for some reason the cookie is not being created right, I think, or at least not being checked right. My webpage won't load until I delete the cookie. Inside my folder, with the other cookies, they look like this:

cookie:name@www.stuff.com

my cookie looks like this:

prp/

(prp is the name of my site)

So what's wrong? here is the code that makes the cookie:

PHP Code:
 setcookie("mem"session_id(), time()+(3600*24*30*4)); 


Is this the problem, does anyone know?

I also had a problem where my front page that was checking for the cookies was sending a wrong variable to the login page, but I fixed that. I think it's jsut having a problem reading the cookie...

Okay thanks you guys

ah I'll attach my other stuff so you won't have to ask:
Attached Files
File Type: txt check.txt (9.6 KB, 276 views)
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old July 21st, 2003, 01:31 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Are you first checking to see if the cookie already exists? If not, it's possible that you're overwriting the old cookie with a new session_id value, which is associated with no data.

Reply With Quote
  #3  
Old July 22nd, 2003, 03:29 AM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
this does it

yah i check with this

PHP Code:
if(!$dtlsSecurity->IsLoggedIn() && !is_numeric(strpos($_SERVER["PHP_SELF"], "login.php")))
{
if(
$_COOKIE['mem'] != '')
{
header("location: index.php?page=login&strMethod=checklogin");
}



login does this:

PHP Code:
if($strMethod == "")
        
$strMethod $_GET["strMethod"];

    if(!
$dtlsSecurity->IsLoggedIn())
            {

                switch(
$strMethod)
                        {
                                case 
"check_login":
                                        
ProcessLogin();
                                        break;
                                case 
"checklogin";
                                        
CheckCookie();
                                        break;
                                default:
                                        
GetLogin();
                                        break;
                        }
                        
            } 


So yah it checks for it, and i know its not replacing it... it's jsut acting as though it's stuck in a loop, but I don't know why...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > cookie problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT