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 September 5th, 2002, 11:01 PM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
Exclamation Login /w cookies

Well, I've been developing a member system for my site however I have just struck a block. I would like to store a cookie in the client's browser so the first time he logs on he stays logs on forever until he logs off by clicking the log off button. So if he logged on today & visited a week later, he'd still be logged on.
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #2  
Old September 6th, 2002, 12:05 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
$name = "username";
$value = "my username";
$date = date("r",strtotime("+90 day"));
$path = "/";

header("Set-Cookie: $name=$value; expires=$date; path=$path;");

this would expire in 90 days store a cookie variable as username and contain the variable my username

its also accessable from any dir under the current one

Reply With Quote
  #3  
Old September 6th, 2002, 11:24 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
I've tried the setcookie() function however I still cannot set a cookie...
PHP Code:
if ($status == 1)
{
    
    
$date time() + 3600;
    
$cookiename "loginInfo";
    
$cookiepath "/";
    
$cInfo $login_username.'|'.$login_password;
    
setcookie($cookiename$cInfo$date$cookiepath);
    
header("Location: [url]http://www.gotlag.com/[/url]");

    exit();



Any ideas?

Edit: Ignore the <a> tag in the header(). vb is putting the code in by itself...

Last edited by wAr-AnGeL : September 6th, 2002 at 11:54 AM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Login /w cookies


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 3 hosted by Hostway