TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-09-2009, 09:18 PM   #1 (permalink)
The Wanderer
 
Mike's Avatar
 
Join Date: Jun 2009
Posts: 11
Thanks: 0
Mike is on a distinguished road
Default Destroy Session when close browser

Hi guys, i've been sratching my head finding a way to solve this problem, i have a user login using PHP session, when a user close the browser without login out the session stil remains, so when the user opens the browser again he won't have to log in, cause the session exists yet.

I need to destroy the session when the user closes the browser,
my php.ini has a session.cookie_lifetime = 0 configuration, but the session seems to never expire.

does anyone know a way to do that?
Mike is offline  
Reply With Quote
Old 07-09-2009, 09:32 PM   #2 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

http://us3.php.net/setcookie
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 07-09-2009, 09:36 PM   #3 (permalink)
The Wanderer
 
Mike's Avatar
 
Join Date: Jun 2009
Posts: 11
Thanks: 0
Mike is on a distinguished road
Default

yes, i know how to set cookies and i know they're easier to handle, but i want to handle user sessions with php session though :P
Mike is offline  
Reply With Quote
Old 07-09-2009, 10:53 PM   #4 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

It's a no go. PHP sessions are stored on the server but the session id is a cookie. In the process of using sessions you will inevitable use a cookie.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Session class.... allworknoplay Absolute Beginners 1 05-04-2009 09:57 PM
Huge Session Problem Killswitch General 1 11-17-2008 02:36 AM
storing class instance into session nizzy Advanced PHP Programming 3 10-02-2008 06:49 AM
Destroy Session on Browser Window Closing buildakicker General 4 05-08-2008 06:05 PM
Understanding the Life of a Session Wildhoney General 6 10-27-2007 02:34 AM


All times are GMT. The time now is 04:39 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design