473,473 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Remember Me option

pek
Any ideas on how to create a remember me option in a login box..?

Jan 21 '06 #1
4 3592

"pek" <ki******@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Any ideas on how to create a remember me option in a login box..?


You need to save an ID, something you can use to identify users by, to a
cookie. Something like...

$setcookie( 'userId', $userID );

Then when they come back check for the value in the cookie structure.

if (isset( $_COOKIE['userId'] ))
{
$userId = $_COOKIE['userId'];
}

But, you have to be careful with the security risk this creates. At least
make sure that $userId is not a sequential number so it can't be faked to
gain unathorized access to someone else's records.

Balazs
Jan 21 '06 #2
pek wrote:
Any ideas on how to create a remember me option in a login box..?


<news:11**********************@z14g2000cwz.googleg roups.com> (
http://groups.google.com/group/comp....0fad0eef59415a )

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 21 '06 #3
pek
I user sessions..
Does that have anything to do with this..?
I mean, I can still use sessions and for the "Remember me" option I
will use cookies..Right..?
I also heard I need to make the cookie expire after a long will..
I tried doing it but didn't know how it works.. :S

Jan 21 '06 #4

"pek" <ki******@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I user sessions..
Does that have anything to do with this..?
I mean, I can still use sessions and for the "Remember me" option I
will use cookies..Right..?
I also heard I need to make the cookie expire after a long will..
I tried doing it but didn't know how it works.. :S


You use the session to track a user's actions through your site. By default
a session lasts as long as the browser is open, but this can be changed.

http://us2.php.net/manual/en/ref.session.php

You use the cookie to identify a user. But when they return the next time
they will probably start a new session.

Here's how to set the expiration of your cookie:

http://us2.php.net/manual/en/function.setcookie.php

Balazs

Jan 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Hal Robertson | last post by:
I have created a rather complicated series of html forms for a data entry wizard In my mozilla browser, every time I submit each form along the process, it asks me if I want to remember the...
2
by: Erwin Moller | last post by:
Hi, Does anybody know if it is possible to suggest to the browser to NOT offer 'remember values' in forms on a page? And if so: how? ;-) I have this situation where a page has a lot of...
3
by: coffee_man | last post by:
Hi, I have a page with a form. This form has an input field <textarea>. I use it to have my users enter text and on form submit it gets inserted into a db. Initially there is some standard text...
3
by: TCORDON | last post by:
Can someone give me a sample or point me in the direction of one, on how to implement User "Remember Me" option when logging into a website? TIA
1
by: | last post by:
I'm currently at the Macromedia Max Developer Conference in California and was impressed by vendor's InterAct User Authentication system which bascially allows one to smash together a 'Remember Me'...
4
by: gencode | last post by:
In asp.net 2.0 there is a Login Control, but I dont want the option to remember the person, is there anyway to hide the"remember me checkbox" I could not see one, Thanks, Ed,
2
by: Dan | last post by:
Hi, I use the logon control for logging into the application. When logging and checking the option "remember me next time" and then closing the browser without to press any logout button which...
2
by: André | last post by:
Hi, When clicking on "remember me" when logging, the user asks for not to have to log in next time he visits the site. Now, on one side, i read it is recommended to logout properly (clicking...
1
by: Pranjal9880 | last post by:
hi all, I am developing the login page in which i ve one check box for the remember me option...If the user check that box and then submit the request the user's login info should be saved ...I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.