Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
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!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
 
Register now for full access!
Old 12-31-2007, 07:45 PM Re: Auto login script
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
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
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
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

Please login or register to view this content. Registration is FREE
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: kokokoko
Trades: 0
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.
©®azy-¢øÐ3R is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Auto login script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.44157 seconds with 12 queries