Connecting Tech Pros Worldwide Forums | Help | Site Map

How to autologin?

Newbie
 
Join Date: Aug 2007
Posts: 3
#1: Aug 2 '07
If I have a login page, and i want to leave the others to access without writing username and password how to do it?

There is a form and I can do it with input type hidden, but in "view source page" the others can see the username and password.

How to implements it?

nathj's Avatar
Expert
 
Join Date: May 2007
Location: North Tyneside
Posts: 857
#2: Aug 2 '07

re: How to autologin?


Quote:

Originally Posted by iriu

If I have a login page, and i want to leave the others to access without writing username and password how to do it?

There is a form and I can do it with input type hidden, but in "view source page" the others can see the username and password.

How to implements it?

If I were you I would take a look at the $_SESSION and $_COOKIE in php. These should help you.

Have a look at this tutorial. I've never used it but it seems okay to me.

Cheers
nathj
jx2 jx2 is offline
Familiar Sight
 
Join Date: Feb 2007
Location: Bristol UK
Posts: 227
#3: Aug 2 '07

re: How to autologin?


Quote:

Originally Posted by nathj

If I were you I would take a look at the $_SESSION and $_COOKIE in php. These should help you.

DONT USE COOKIE for that purose - cookies can be seen in internet files

use session!!

i hope tht helped
jx2
nathj's Avatar
Expert
 
Join Date: May 2007
Location: North Tyneside
Posts: 857
#4: Aug 2 '07

re: How to autologin?


Quote:

Originally Posted by jx2

DONT USE COOKIE for that purose - cookies can be seen in internet files

use session!!

i hope tht helped
jx2

I personally agree and never use cookies, however, I thought I would present both options, for the sake of completeness

nathj
volectricity's Avatar
Expert
 
Join Date: Jun 2007
Location: Baltimore
Posts: 587
#5: Aug 2 '07

re: How to autologin?


Quote:

Originally Posted by jx2

DONT USE COOKIE for that purose - cookies can be seen in internet files

use session!!

If he's actually after an auto-login (though the post sounds very confusing, so he may be after something else), then a session wouldn't work at all. A cookie would need to be used. Any auto-login (i.e. these forums) are done through a cookie, because sessions don't last indefinitely.
Reply