Jump to content

cookies vs. sessions


desithugg

Recommended Posts

umm i use both cookies and sessions for my login system depending on if the user has cookies enabled or not.
it works fine but 1 person cant login...he uses internet explorer cookies enabled(accepts al cookies)..
but he still cant get in not with cookies or sessions.
I was wondering if theres any other way to pass information safley like username and password.
Link to comment
https://forums.phpfreaks.com/topic/31828-cookies-vs-sessions/
Share on other sites

You can try:

[code=php:0]
$username = $_POST['username'];
$password = $_POST['password']; //or md5($_POST['password']) whichever you're using
if(isset($username) && isset($password)){

$cookie1 = setcookie("name","value","time");
$cookie2 = setcookie("name","value","time");
//etc...

if($cookie1 && $cookie2){
//log in using cookies
}else {
$_SESSION['sess1'] = sess1;
$_SESSION['sess2'] = sess2;
}
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/31828-cookies-vs-sessions/#findComment-147722
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.