Netty Posted October 27, 2006 Share Posted October 27, 2006 how would i stay logged into a website. when i go offline?is there a script to do this?thanks alot. Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 27, 2006 Share Posted October 27, 2006 Not quite clear. Do you want users to your site to be able to return to the site without having to log in again? If so, then just use cookies to save the user login data. When they return to the site, check to see if there is a cookie w/ data and if so log them in with that data.BTW: that's my same response to your identical question in the Computing.net forum. LOL. Quote Link to comment Share on other sites More sharing options...
Netty Posted October 27, 2006 Author Share Posted October 27, 2006 lmao. what a cowinkidink :)but seriously .. is there a script to do it? Quote Link to comment Share on other sites More sharing options...
jpratt Posted October 27, 2006 Share Posted October 27, 2006 I am not sure if you will find a script that you can just cut and paste in and work how you want. Your best bet is to do some reasearch on cookie with php then look for simalar scripts. If you are going to write your own or modify someone elses you will need to know what is going on. Quote Link to comment Share on other sites More sharing options...
briant Posted October 27, 2006 Share Posted October 27, 2006 I'm wondering, did you want to be logged onto your website or someone else's?As for your own website, it's possible but you would need to provide your site.As for someone else's website, unless you have access to their php code, then no, you can't be able to do it. Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 27, 2006 Share Posted October 27, 2006 Assuming you have a login script you need to add the following functionality:Upon a successful login, save the username & password (MD5 hash or something similar I hope) to a cookie.For any pages where you check login status, if the user is not already logged in, check if they have a cookie set and attempt to log them in using those credentials. Quote Link to comment Share on other sites More sharing options...
alpine Posted October 27, 2006 Share Posted October 27, 2006 Cookie example - one year expire time, more info on http://no.php.net/manual/fi/function.setcookie.php[code]<?phpsession_start();// check for valid user on loginif($login_ok) // simplified example{setcookie("cookie_name", "cookie_value", time()+60*60*24*365,"/",".yourdomain.com",0);}// or on logout, same parameters but with negative expire periodif($logout) // simplified example{setcookie("cookie_name", "cookie_value", time()-60*60*24*365,"/",".yourdomain.com",0);}?>[/code] Quote Link to comment Share on other sites More sharing options...
Netty Posted October 27, 2006 Author Share Posted October 27, 2006 hehe ... ok ... over my head all this ...how do i get the login cookie? log into the site .. then go to my "Cookies" folder?any one have an instant messanger to talk me thru it? Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 27, 2006 Share Posted October 27, 2006 By your response on Computing.Net I can see that you are wanting to stay logged in to another site. A cookie isn't going to help you do that. It may be possible to launch a php page to log into another site and keep that login state, but I don't know how. Quote Link to comment Share on other sites More sharing options...
Netty Posted October 28, 2006 Author Share Posted October 28, 2006 i have been told you can do it using cURL?do you think that thats possible? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.