homepage Welcome to WebmasterWorld Guest from 54.226.147.84
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Manage Session On Cookie Disabled Browser
when cookie is disabled, and don't use query string
compose

5+ Year Member



 
Msg#: 3443852 posted 9:17 am on Sep 7, 2007 (gmt 0)

Hi,

I am in one confusion how session will be managed if cookie is disabled on client browser and also don't want to use query string to attach session id with url.
is there any way to implement session in this situation?

one more question how sessions are managed between server and browser?

thanks...

Vinic

 

joelgreen

5+ Year Member



 
Msg#: 3443852 posted 10:56 am on Sep 7, 2007 (gmt 0)

I believe session cannot live if cookies are disabled on client browser and you don't want to use query string to attach session id with url.

how sessions are managed between server and browser

As you already said, via cookie or by adding session id to the query string.

Browser connects to the server, server sets session cookie, which is a usual cookie. Session cookie will be passed along with other cookies/values second time browser connects to the server. The only difference between session cookie and other cookies is PHP has internal support for session cookie to make it hassle-free for programmers.

Receptional Andy



 
Msg#: 3443852 posted 10:59 am on Sep 7, 2007 (gmt 0)

The only possibilities that don't use cookies or query strings will be troublesome and prone to error.

You could for instance write an identifier to a hidden field on the page, and then maintain the session by POSTing each page to the next one, or alternatively trying to identify the user based on IP and other known info and maintaining the session behind the scenes based on this.

compose

5+ Year Member



 
Msg#: 3443852 posted 11:11 am on Sep 7, 2007 (gmt 0)

Thanks for reply, i also assume same, but some one asked me that if i have disabled cookies in my system, then how your application will work, so i was confused?

so can you please tell in that case what we have to do? means for such situation we have to do additional code for precaution?

Receptional Andy



 
Msg#: 3443852 posted 11:47 am on Sep 7, 2007 (gmt 0)

The standard practice is cookies with a fallback to session IDs in URLs. If you do fall back to URL-based sessions you need to ensure that these are not served to search engine spiders (who don't accept cookies).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved