Demonic Posted March 27, 2008 Share Posted March 27, 2008 I was wondering since sessions don't work well with applications (logging in from a program to download data from a website doesn't allow the session to be persistent) So I was wondering if I should set a cookie based on the current session id, store that session in the database with the current time. Then I can manipulate my script to delete sessions after so long to make them re`login, that way I can use my python program to login yet it will log them out in a certain time(possibly 24 hours or less). So, is it a good idea to store current session in db with the current time and in the users table, then store that session in a cookie to stay logged in then delete the cookie in db, and if that session no longer exists in the database they have to re`login. Quote Link to comment https://forums.phpfreaks.com/topic/98204-is-this-a-good-idea-sessions-cookies-manipulation-read/ Share on other sites More sharing options...
laffin Posted March 27, 2008 Share Posted March 27, 2008 why not just implement the sessions in your own fashion. Thus bypassing sessions entirely Quote Link to comment https://forums.phpfreaks.com/topic/98204-is-this-a-good-idea-sessions-cookies-manipulation-read/#findComment-502505 Share on other sites More sharing options...
discomatt Posted March 27, 2008 Share Posted March 27, 2008 By default, the session id is stored in a cookie. To hold the session, when the user logs on, send the session ID back to the application, and just call the pages as: page.php?PHPSESSID=sessionid When the session id expires, have the php page send that information back to the application Quote Link to comment https://forums.phpfreaks.com/topic/98204-is-this-a-good-idea-sessions-cookies-manipulation-read/#findComment-502506 Share on other sites More sharing options...
Demonic Posted March 27, 2008 Author Share Posted March 27, 2008 Thanks I'll try that. Sorry but that doesn't work, I think it only works when your actually browsing the site. Quote Link to comment https://forums.phpfreaks.com/topic/98204-is-this-a-good-idea-sessions-cookies-manipulation-read/#findComment-502507 Share on other sites More sharing options...
Demonic Posted March 27, 2008 Author Share Posted March 27, 2008 Nvm I got it to work, I forgot I had to set the "submit" input to true, since I asked if the submit button was set . Quote Link to comment https://forums.phpfreaks.com/topic/98204-is-this-a-good-idea-sessions-cookies-manipulation-read/#findComment-502526 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.