Submit Your Article Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read


Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-23-2007, 09:33 PM
WebProWorld Pro
 
Join Date: Jan 2004
Location: Milton Keynes, UK
Posts: 115
DarrenPWS RepRank 0
Default PHP Sessions Issue

Hi all

My website is done in php. I have a session running on the server, and the session_id is used to store unique information in our database about the visitor, ie where they came from, their ip, any products added to the basket etc etc.

I have noticed that when the user first visits the site, the session does not seem to start, and thus on the first page there is no session_id and therefore I cannot store any useful info about their visit.

I used to have a 302 redirect which would solve this issue by refreshing the page and then registering the session (but keeping referer info) - but this stopped google from crawling my site...

..SO... do you know how to get round this issue? Am I doing something wrong?

Many thanks

Darren

PS - excuse the long post, it's late!
__________________
Darren Darkins
Reply With Quote
  #2 (permalink)  
Old 03-23-2007, 09:59 PM
WebProWorld Pro
 
Join Date: Jan 2004
Location: Milton Keynes, UK
Posts: 115
DarrenPWS RepRank 0
Default

...have answered my own question.

I added:

if (!$session_id)
{
$session_id = session_id();
}
__________________
Darren Darkins
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
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

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



All times are GMT -4. The time now is 10:43 PM.



Search Engine Optimization by vBSEO 3.3.0