homepage Welcome to WebmasterWorld Guest from 184.73.87.85
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Session Array is empty
Gilead




msg:4398328
 6:14 pm on Dec 15, 2011 (gmt 0)

I am building a menu based on a session variable. If it's admin, then echo out the admin full menu. If superuser, echo out the super user menu which has less stuff in it.

I have tried this on my machine(XP) and on my laptop (ubuntu linux) and my father's machine(mint linux). When it is run on a windows 7 machine, the session array is blank and the menu is not displayed. How is that possible?
I don't get it!

Can anyone shed some light on this so it can work for EVERYONE?
Thanks!

 

penders




msg:4398335
 6:40 pm on Dec 15, 2011 (gmt 0)

Have you tried different browsers on the Win7 machine?

The session is probably dependent on a cookie being set in the browser, I can only guess that the cookie is being blocked on that machine? As otherwise the client should not affect the server-side session.

Gilead




msg:4398343
 6:57 pm on Dec 15, 2011 (gmt 0)

It's been tried on two win7 laptops. I will ask about cookies.

Matthew1980




msg:4398449
 10:53 pm on Dec 15, 2011 (gmt 0)

>>The session is probably dependent on a cookie being set in the browser.

Ensure that ALL browsers have permissions/abilities to set cookies/sessions - as essentially they are both the same thing.

Also, put some code in to varify that cookies/sessions have been set as expected, or just pop a friendly message on stating that your site requires cookies/sessions turned on in order to function.

Hope that makes sense.

Cheers,
MRb

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved