--- Chris Bier wrote:
Jack wrote:
I'm having problems with some pages I'm writing
for a
client. I'm using session variables, however every time I go to a new page I'm losing the session id and creating a new one. ...
Are you using session_start(); at the beginning of each page?
Sorry, I hadn't meant to post that question yet.
Here's what I was doing: <?php //page1.php session_start(); $_SESSION['sid'] = session_id(); $sid = $_SESSION['sid']; ... ?> <html> ... <form action="page2.php?SID=<?php echo $sid; ?>" ...> ... </html>
============================================
<?php //page2.php session_start(); $_SESSION['sid'] = session_id(); $sid = $_SESSION['sid']; ... ?> <html> ... <form action="page1.php?SID=<?php echo $sid; ?>" ...> ...
Here's what I just tried:
<?php //page1.php
if (isset($_GET['SID')) { $_SESSION['sid'] = session_id($_GET['SID']); } if (session_id() === "") { session_start(); }
...
which is working, but it's a real kludge. I'd really like to only use the get if cookies aren't enabled.
Thanks all, Brian </textarea> </td> </tr> </table> </td> </tr> </table>
<table border=0 cellpadding=4 cellspacing=0> <tr valign=top> <td align="right" nowrap> </td> <td nowrap> <input type=checkbox name="SigAtt" value="1" id="SA"><label for="SA">Use my signature</label> </td> </tr> </table> </div>
<!-- END APPLICATION CONTENT --> </td> </tr> </table>
<div id="composebuttonbarbottom"> <button type="button" name="sendbottom" id="sendbottom" value="Send" title="Send Message" tabindex="10" onclick="Send_Click();" style="position:static;">Send</button> <button type="button" name="savedraftbottom" id="savedraftbottom" value="Save as a Draft" title="Save Message in your Drafts folder" tabindex="11" onclick="SaveDraft_Click(this);" style="position:static;">Save as a Draft</button> <button type="button" name="spellcheckbottom" id="spellcheckbottom" value="Spell Check" title="Check your message's spelling before sending" tabindex="12" onclick="SpellCheck_Click();" style="position:static;">Spell Check</button> <button type="button" name="cancelbottom" id="cancelbottom" value="Cancel" title="Cancel" tabindex="13" onclick="Cancel_Click(this);" style="position:static;">Cancel</button> </div>
</span> <span id=sending style="display:none"> <table class="applicationcontainer composeview" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> <td rowspan="2" id="first" nowrap="nowrap" width="7"><spacer type="block" width="7"></td> <td> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> <td id="spacer" nowrap="nowrap" width="3"><spacer type="block" width="3"></td> <td class="content" height="5" width="100%"><spacer type="block" height="5"></td> </tr> </tbody></table> </td> </tr> <tr valign="top"> <td> <h2 id="stateindicator" style="padding:5px 10px;">Sending Message</h2> <table cellpadding="10" cellspacing="0" border="0" style="background-color:#F6F6F6;"> <tbody> <tr> <td id="uploadmessage" style="font-weight:bold;"></td> </tr> <tr> <td> <div id="photomailuploadprogress" class="progressbar"> <div class="hd"> </div> <div class="bd"> <span></span> </div> <div class="ft"> </div> </div> </td> </tr> <tr style="display:none;"> <td id="photomailpromosendmessage" style="padding-bottom:10px;"></td> </tr> </tbody> </table> </div> </td> </tr> </tbody></table> <div id="globalbuttonbarbottom" class="globalbuttonbar composebuttonbar"> <button type="button" name="cancelbottom" id="cancelbottom" value="Cancel" title="Cancel" onclick="CancelUpload()">Cancel</button> </div> </span>
<script> function composeClickHandler(loc) { try{ if( parent.showCompose ) parent.showCompose(); else window.location = loc; } catch(error){ window.location = loc; } } </script> <div id="mailshortcuts" class="shortcuts"> <strong><a name="mailshortcuts">Mail Shortcuts</a></strong> <div> <ul class="first"> <li class="special"><a href="http://us.f524.mail.yahoo.com/ym/ShowFolder?rb=Inbox&YN=1&YY=652540">Check Mail</a> Ctrl+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/pim/r/medici/all/shift1.gif" width="9" height="8" alt="shift" border="0">+C</li> <li class="special"><a href='javascript:if(typeof(composeClickHandler)!="undefined")composeClickHandler("http://us.f524.mail.yahoo.com/ym/Compose?YY=146964");else{window.location="http://us.f524.mail.yahoo.com/ym/Compose?YY=606002";}'>Compose</a> Ctrl+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/pim/r/medici/all/shift1.gif" width="9" height="8" alt="shift" border="0">+P</li> </ul> <ul> <li class="special"><a href="http://us.f524.mail.yahoo.com/ym/Folders?YY=870539">Folders</a> Ctrl+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/pim/r/medici/all/shift1.gif" width="9" height="8" alt="shift" border="0">+F</li> <li class="special"><a href="http://us.f524.mail.yahoo.com/ym/Search?P=1&YY=272180">Advanced Search</a> Ctrl+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/pim/r/medici/all/shift1.gif" width="9" height="8" alt="shift" border="0">+S</li> </ul> <ul class="last"> <li><a href="http://us.f524.mail.yahoo.com/ym/Options?YY=283893">Options</a></li> <li class="special"><a target="_top" href="http://help.yahoo.com/help/us/mail/">Help</a> Ctrl+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/pim/r/medici/all/shift1.gif" width="9" height="8" alt="shift" border="0">+H</li> </ul> </div> </div>
<div id="addressbookshortcuts" class="shortcuts"> <strong><a target="_top" name="addressbookshortcuts">Address Book Shortcuts</a></strong> <div> <ul class="first"> <li><a target="_top" href="http://address.mail.yahoo.com?addcontact">Add Contact</a></li> <li><a target="_top" href="http://address.mail.yahoo.com?Add&A=g">Add Category</a></li> <li><a target="_top" href="http://address.mail.yahoo.com?edit_grp">Add List</a></li> </ul> <ul> <li><a target="_top" href="http://address.mail.yahoo.com">View Contacts</a></li> <li><a target="_top" href="http://address.mail.yahoo.com?A=v&cat=__ll">View Lists</a></li> </ul> <ul> <li><a target="_top" href="http://us.f524.mail.yahoo.com/ym/quickbuilder">Quickbuilder</a></li> <li><a target="_top" href="http://address.mail.yahoo.com?A=B">Import Contacts</a></li> <li><a target="_top" href="http://address.mail.yahoo.com?A=x&A2=11">Synchronize</a></li> </ul> <ul class="last"> <li><a target="_top" href="http://address.mail.yahoo.com?A=o">Addresses Options</a></li> <li><a target="_top" href="http://help.yahoo.com/help/us/ab/">Addresses Help</a></li> </ul> </div> </div>
<div id="calendarshortcuts" class="shortcuts"> <strong><a target="_top" name="calendarshortcuts">Calendar Shortcuts</a></strong> <div> <ul class="first"> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=5">Add Event</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=33">Add Task</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=5&evt_type=13">Add Birthday</a></li> </ul> <ul> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=0">Day</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=1">Week</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=2">Month</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=3">Year</a></li> </ul> <ul> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=42">Event List</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=42&POS=0&TYP=101&MOD=0">Reminders</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=32">Tasks</a></li> </ul> <ul> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=84">Sharing</a></li> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=120">Synchronize</a></li> </ul> <ul class="last"> <li><a target="_top" href="http://calendar.mail.yahoo.com/?v=70">Calendar Options</a></li> <li><a target="_top" href="http://help.yahoo.com/help/us/cal/">Calendar Help</a></li> </ul> </div> </div>
<div id="notepadshortcuts" class="shortcuts"> <strong><a target="_top" name="notepadshortcuts">Notepad Shortcuts</a></strong> <div> <ul class="first"> <li><a target="_top" href="http://notepad.mail.yahoo.com/?v=161">Add Note</a></li> <li><a target="_top" href="http://notepad.mail.yahoo.com/?v=168">Add Folder</a></li> </ul> <ul> <li><a target="_top" href="http://notepad.mail.yahoo.com/?v=164">View Notes</a></li> </ul> <ul class="last"> <li><a target="_top" href="http://notepad.mail.yahoo.com/?v=165">Notepad Options</a></li> <li><a target="_top" href="http://help.yahoo.com/help/us/notepad/">Notepad Help</a></li> </ul> </div> </div>
<div id="searchmenu" class="buttonmenu"> <strong>Advanced Search</strong> <ul><li value="0">Advanced Search</li></ul> </div> <script type="text/javascript">
if(typeof Search_Click_top != 'undefined' && typeof Search_Click_bottom != 'undefined') { var oSearchTop = MenuButton('searchmail0',Search_Click_top,'searchmenu',SearchMenu_Click); var oSearchBottom = MenuButton('searchmail1',Search_Click_bottom,'searchmenu',SearchMenu_Click); } </script> <br>
<script language=javascript> var ADFadids = "2378664,1052425"; function ADFlaunch() {var w; var l="http://us.ard.yahoo.com/SIG=12h45sej4/M=224039.2020109.3495275.1958505/D=mai...; w=window.open(l,"AdFeedbackWin","toolbar=no,scrollbars=yes,resizable,location=no,height=400,width=640"); }</script><center><small><br>Copyright © 1994-2005 <a href="http://us.ard.yahoo.com/SIG=12h45sej4/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/Y=YAHOO/EXP=1123884883/A=1052425/R=1/mail_us/tos/SIG=10mgpruen/*http://www.yahoo.com" target="_top">Yahoo!</a> Inc. All rights reserved. <a href="http://us.ard.yahoo.com/SIG=12h45sej4/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/Y=YAHOO/EXP=1123884883/A=1052425/R=2/SIG=1136qnvkg/*http://docs.yahoo.com/info/terms/" target="_top">Terms of Service</a> - <a href=http://us.ard.yahoo.com/SIG=12h45sej4/M=224039.2020109.3495275.1958505/D=mai... target="_top">Copyright/IP Policy</a> - <a href="http://us.ard.yahoo.com/SIG=12h45sej4/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/Y=YAHOO/EXP=1123884883/A=1052425/R=4/SIG=11he80eif/*http://docs.yahoo.com/info/guidelines/mail.html" target="_top">Guidelines</a> - <a href="javascript:ADFlaunch()">Ad Feedback</a><br>NOTICE: We collect personal information on this site.<br>To learn more about how we use your information, see our <a href="http://us.ard.yahoo.com/SIG=12h45sej4/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/Y=YAHOO/EXP=1123884883/A=1052425/R=5/SIG=11b5p6lhe/*http://privacy.yahoo.com/privacy/us/mail/" target="_top">Privacy Policy</a></small></center> <!-- SpaceID=150500005 loc=FSRVY noad --> <script type="text/javascript"> if (window.yzq_a == null) document.write("<scr" + "ipt type=text/javascript src=http://us.js1.yimg.com/us.yimg.com/lib/bc/bc_1.7.0.js%3E</scr" + "ipt>"); </script><script type="text/javascript"> if (window.yzq_a) { yzq_a('p', 'P=F_cL186.J3mnvTS9QvKKeQBGDNvG6EL9AzMABbHt&T=13q5t9dd9%2fX%3d1123877683%2fE%3d150500005%2fR%3dmail%2fK%3d5%2fV%3d1.1%2fW%3d8%2fY%3dYAHOO%2fF%3d4209078297%2fS%3d1%2fJ%3dAD30BECE'); yzq_a('a', '&U=129bnmed2%2fN%3dndrRUc6.Iqw-%2fC%3d-1%2fD%3dFSRVY%2fB%3d-1'); } </script><noscript><img width=1 height=1 alt="" src="http://bc.us.yahoo.com/b?P=F_cL186.J3mnvTS9QvKKeQBGDNvG6EL9AzMABbHt&T=13vjh61fj%2fX%3d1123877683%2fE%3d150500005%2fR%3dmail%2fK%3d5%2fV%3d2.1%2fW%3d8%2fY%3dYAHOO%2fF%3d1442647043%2fQ%3d-1%2fS%3d1%2fJ%3dAD30BECE&U=129bnmed2%2fN%3dndrRUc6.Iqw-%2fC%3d-1%2fD%3dFSRVY%2fB%3d-1"></noscript> <!-- SpaceID=150500005 loc=FR001 noad --> <script type="text/javascript"> if (window.yzq_a == null) document.write("<scr" + "ipt type=text/javascript src=http://us.js1.yimg.com/us.yimg.com/lib/bc/bc_1.7.0.js%3E</scr" + "ipt>"); </script><script type="text/javascript"> if (window.yzq_a) { yzq_a('p', 'P=F_cL186.J3mnvTS9QvKKeQBGDNvG6EL9AzMABbHt&T=13qe25puh%2fX%3d1123877683%2fE%3d150500005%2fR%3dmail%2fK%3d5%2fV%3d1.1%2fW%3d8%2fY%3dYAHOO%2fF%3d2579652163%2fS%3d1%2fJ%3dAD30BECE'); yzq_a('a', '&U=13a7t3j0l%2fN%3dm9rRUc6.Iqw-%2fC%3d224039.2020109.3495275.1958505%2fD%3dFOOT2%2fB%3d1052425'); } </script><noscript><img width=1 height=1 alt="" src="http://bc.us.yahoo.com/b?P=F_cL186.J3mnvTS9QvKKeQBGDNvG6EL9AzMABbHt&T=13v3nlrc3%2fX%3d1123877683%2fE%3d150500005%2fR%3dmail%2fK%3d5%2fV%3d2.1%2fW%3d8%2fY%3dYAHOO%2fF%3d4111882075%2fQ%3d-1%2fS%3d1%2fJ%3dAD30BECE&U=13a7t3j0l%2fN%3dm9rRUc6.Iqw-%2fC%3d224039.2020109.3495275.1958505%2fD%3dFOOT2%2fB%3d1052425"></noscript>
</form>
<script> if(self.name != "ymailcompose") { document.write("<script src='http://address.mail.yahoo.com/acjs3/us/N5kTTfgboVZljoefcbRCxw--'></" + "script>"); } </script> </body> </html> <!-- v3.302.16.12.0.2 1121375758 --> <!-- 0.08847 --> <script type="text/javascript"> if (window.yzq_a == null) document.write("<scr" + "ipt type=text/javascript src=http://us.js1.yimg.com/us.yimg.com/lib/bc/bc_1.7.0.js%3E</scr" + "ipt>"); </script><script type="text/javascript"> if (window.yzq_a) yzq_a('p', 'P=F_cL186.J3mnvTS9QvKKeQBGDNvG6EL9AzMABbHt&T=13qcrmbmi%2fX%3d1123877683%2fE%3d150500005%2fR%3dmail%2fK%3d5%2fV%3d1.1%2fW%3dG%2fY%3dYAHOO%2fF%3d3550529598%2fS%3d1%2fJ%3dAD30BECE'); if (window.yzq4) yzq4(); </script><noscript><img width=1 height=1 alt="" src="http://bc.us.yahoo.com/b?P=F_cL186.J3mnvTS9QvKKeQBGDNvG6EL9AzMABbHt&T=13vhftc8i%2fX%3d1123877683%2fE%3d150500005%2fR%3dmail%2fK%3d5%2fV%3d3.1%2fW%3dG%2fY%3dYAHOO%2fF%3d2817691684%2fQ%3d-1%2fS%3d1%2fJ%3dAD30BECE"></noscript> <!-- web52410.mail.yahoo.com compressed/chunked Fri Aug 12 13:14:43 PDT 2005 -->
__________________________________ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html