Gossamer Forum
Home : General : Internet Technologies :

lot of people cant loginto my site that uses cookies

Quote Reply
lot of people cant loginto my site that uses cookies
ive had a lot of people with IE4.0, 5, 5.5 that cannot log into my php website that users cookies to store login info. They login with the correct user and pass and they are bought straight back to the login screen with no error messages no nuthin, how can so many people have trouble logging into the site?? dont cookies come enabled as standard in IE???
Could there be another reason that they cant login? ive talked one person through enabling cookies on the phone with IE5.0 and they were all enabled, he had no firewalls no nuthin and he still couldnt loginto my website.
Does anyone know any reason for not being able to login? am i using cookies wrong or something? 50% of people dont have a problem in the world, 50% do.
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
It might help if you provided a code snippet within your login script, so that we can see what you're doing. May be it's improper codes on your end that is causing the problem...and with volume of 50% of your users unable to login to your website, that is a problem.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] lot of people cant loginto my site that uses cookies In reply to
well i set a new session when they login

setcookie($cookiename,$sid,time()+$sessionlength);

then i read the cookie like this on every page load

$sid = $_COOKIE[$cookiename]

then compare whats in the cookie to whats in the database as the session ID. if it dont match then they are sent to the login page, works fine on 50% of machines.
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
Using a path in your cookie would be a good start. See what happens after that.
Quote Reply
Re: [Paul] lot of people cant loginto my site that uses cookies In reply to
ok, im setting the cookie like this at the moment.



setcookie($cookiename,$sid,time()+$sessionlength,'/','.domainname.com');



that what you mean? i will see how this goes.
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
You can probably leave out the domain name but keep '/'

Yeah that was what I meant. See if it helps.
Quote Reply
Re: [Paul] lot of people cant loginto my site that uses cookies In reply to
didnt seem to do anything, just had another email from someone that couldnt login again, keeps sending them back to the login screen without any errors.

Also, if people had an old browser like IE4.0, would this stop them from loggin in as well?

Last edited by:

WoSkI: Feb 19, 2003, 5:03 AM
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
It's quite difficult to see what's going on with only one line of code.

The example you gave looks correct so I don't see that as causing the error.
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
>>>Also, if people had an old browser like IE4.0, would this stop them from loggin in as well? <<<

I shouldn't think so; as long as they have cookies enabled.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
BTW, this is what I use to set cookies in my PHP scripts;

Code:
setcookie(PassStore, $password);
setcookie(UserStore, $username);

(no cookie length value, as they only need to be stored in memory).

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] lot of people cant loginto my site that uses cookies In reply to
Memory?...you mean a browser session cookie :)
Quote Reply
Re: [Andy] lot of people cant loginto my site that uses cookies In reply to
What are PassStore and UserStore?....they don't look like variables but aren't quoted either?
Quote Reply
Re: [Paul] lot of people cant loginto my site that uses cookies In reply to
>>>What are PassStore and UserStore?....they don't look like variables but aren't quoted either? <<<

Erm...PassStore is the variable used to name the cookie. Using;

setcookie(PassStore, $password);

Will allow me to access the cookie via $PassStore anywhere in that folder.....defining the path and domain would allow me to use it anywhere on the site (same as Perl).

The reason its not quoted, is simply cos it doesn't need to be Tongue

Trust me...I know this works...I've had my mailing list script working on tons of servers and PC's :)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] lot of people cant loginto my site that uses cookies In reply to
I'm not denying it works but as you said, you are better than me with php so was interested. As you know it would need quoting in perl.
Quote Reply
Re: [Andy] lot of people cant loginto my site that uses cookies In reply to
In Reply To:
BTW, this is what I use to set cookies in my PHP scripts;

Code:
setcookie(PassStore, $password);
setcookie(UserStore, $username);

(no cookie length value, as they only need to be stored in memory).

Hope that helps.


so how do you set an expiry time for it then?
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
The same way you did in your own example.
Quote Reply
Re: [Paul] lot of people cant loginto my site that uses cookies In reply to
would i be better off using the session thing that php has?
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
I wouldn't recommend it. Doing that, means if someone clicks back, then for some reason it assumes they have logged out. I had this problem on 4templates.com Frown

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] lot of people cant loginto my site that uses cookies In reply to
just had another dude email me saying he cant login, he has

Browser: Internet Explorer
Browser Version: 6.0
Operating System: Windows 98

He says he has enabled cookies but still cant login.

Well this is how the login script works. The person puts his username and password in the boxes and clicks login, the script compares these details against whats in the database and if not correct it will put in red writing that either the username or pass is incorrect and to try again.
If its correct, then a session id is randomly generated and inserted into the session table in the mysql database along with the members ID and the session expiry time and a cookie is set with the data of the session id. People that cant login, i will find many sessions with their ID in it, so it inserts it into the database ok but the cookie seems to return wrong value. Then it goes to the page after login where the first thing the script does is check for valid user. It reads the cookie and gets the session id from it and sees if there is one in the database the same, is theres not then it returns to the login screen with no errors, if there is a match in the database then it will proceed to the next screen.
This is the problem that people are having, it will verify the password and user as correct, try and set the cookie and when it reads the cookie and compares the result to the database session entry it will not match as the cookie seems to return nothing and returns them to the login screen.

Last edited by:

WoSkI: Feb 20, 2003, 5:30 PM
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
Is there a reason you need to track sessions? If not, you might be better off just setting the cookie to expire at a certain time and simply checking if it exists, without using the MySQL database.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] lot of people cant loginto my site that uses cookies In reply to
yes, everyone has a login name and pass, they have their own accounts that contain their info and no one else should have access to their info, its like a bank account, you login and do your stuff and leave and you dont want anyone else playing around in there so they have to log out after they are finished or if they forget the sesison expires by itself.
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
Ah. Well, if the problem seems to be with the setting of the cookie, the only other thing I could recommend is that you take a look at http://www.php.net/...nction.setcookie.php. Hope that helps.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [WoSkI] lot of people cant loginto my site that uses cookies In reply to
Just a small thing but try the login yourself with both the http://www.yourdomain.com and the http://yourdomain.com and http://123.123.123.123/ <- your ip address. If you find that you pages move from one domain to another, due to security constraints, you could very well lose your cookie.

In the above three domain examples, under many situations cookies set for one of the domains will not be available for the other two.
Quote Reply
Re: [Aki] lot of people cant loginto my site that uses cookies In reply to
doubt it is that, MOST people CAN login no problems, its only SOME that cant and never have been able to, ive never had a problem, its not everyone, its only some people, ive fixed some of their problems because of cookie settings as well, has to be that, im dealing with some of the most computer illeterate people trying to use my website, half of them dont know that windows95 is not the latest operating system any more.