Reply
Auto login script
Old 12-31-2007, 07:31 PM Auto login script
The PHP Professor

Posts: 308
Name: Alex
Location: Behind You
I have a login script that allows the users to automatically login when they return to the site later. My problem is that when the user returns to the site they are not logged in automatically, then have to click a link(any link) and then the site will recognize them and log them in?!?!?!

This is done by cookies, i cannot exactly give you the script as it contains a lot of valuable information so can you tell me what i can do to tell me what i can do to make a script set cookies so that when they return next time the script picks up cookies right away????


Thanks all in advance!
__________________
Go Kirby! <(" . "<) (^" . "^) (>" . ")> Talkupation!
Need a FILE host? Nobody gets it done right like 1Stopupload.com!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
When You Register, These Ads Go Away!
Old 12-31-2007, 07:45 PM Re: Auto login script
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Wireless Audio
Posts: 2,322
Name: Keith Marshall
Location: West Hartford, CT
The point when your application is checking for the login cookie, try doing an httpd redirect (using headers) to the visited page to enable logged status.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 12-31-2007, 10:23 PM Re: Auto login script
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 984
Name: Jeremy Miller
Location: Reno, NV
Alternatively, set the correct variables at the beginning of your script. For example, let's say that I have $_SESSION['username'] as the username for someone when logged in (and that's it). Then, at the top of each script I include a file which will check for cookies (say $_COOKIE['auto_login'] for auto logging in) and set the proper session variable in that script. Since it will then be available to all scripts you'll have the user logged in.
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 01-02-2008, 03:06 AM Re: Auto login script
©®azy-¢øÐ3R's Avatar
Average Talker

Posts: 19
Name: ©®azy-¢øÐ3R
Location: Doncaster
erm maybe you need to extend the "session" if they are active or not. then when they leave and come back they will still be logged in you can set the time in the php form from 1 second to 1 day.
__________________
Samari.org <----- check it out.
Proxy @ Samari.org 'N' FatBlitz @ Samari.org...
©®azy-¢øÐ3R is offline
Reply With Quote
View Public Profile Visit ©®azy-¢øÐ3R's homepage!
 
Reply     « Reply to Auto login script
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13089 seconds with 12 queries