Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Session get destroyed randomly

Posted on 2010-11-21
5
Medium Priority
?
262 Views
Last Modified: 2012-05-10
Hello,

I have a web app that uses session for user authenticating, I store the logged in user's username and a specific level. I use the session_start() in every page before any content starts. Upon first login  user get redirected to a page which has some links to specific categories and user can go to each categories by clicking on link. So the issue is sometimes user get redirected again to the login screen because the session is destroyed. I used print_r($_SESSION); through out the site to see if the session is getting removed and some sometimes it return array() no session data at all.

I'm on a shared hosting environment.

Any idea what is happening ?

Thanks in advance.
0
Comment
Question by:sahanz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 6

Expert Comment

by:CyberGhost
ID: 34184344
if you have AJAX calls and use cookies to store your session, it is possible that your cookies get timed out

AJAX calls - to the best of my knowledge - do not work with cookies, so once the session is regenerated, it won't be updated in the browser (cookie) and so the session will be invalidated
0
 
LVL 1

Author Comment

by:sahanz
ID: 34193304
uhmm no ajax stuff.
0
 
LVL 1

Accepted Solution

by:
sahanz earned 0 total points
ID: 34342798
It was a domain issue, the website had links with www. and without. Its fixed now and didnt get the issue after that.

Thanks
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 36110497
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question