bluefusionweb Posted March 5, 2007 Posted March 5, 2007 Hi all this may sound simple enough but I can't seem to get simple text links to work just to point to pages. Do they NEED the ?osCsid=xxxxxxxxxxxxxxxxxxxxxx on the end to actually work? I just want to make a simple link like href="account.php" b ut when i do that its always making me re-login. Doesn;t it use sessions to store login details? How can i make a simple link, if i use the osCid=xxxxxxxxxxxxxxxxxxxxxx bit does that number ever change, is it related to login in info etc etc? I have been having some trouble finding myself logged in as different customers etc for some reason? any help is appreciated James
Velveeta Posted March 5, 2007 Posted March 5, 2007 Hi all this may sound simple enough but I can't seem to get simple text links to work just to point to pages. Do they NEED the ?osCsid=xxxxxxxxxxxxxxxxxxxxxxon the end to actually work? I just want to make a simple link like href="account.php" b ut when i do that its always making me re-login. Doesn;t it use sessions to store login details? How can i make a simple link, if i use the osCid=xxxxxxxxxxxxxxxxxxxxxx bit does that number ever change, is it related to login in info etc etc? I have been having some trouble finding myself logged in as different customers etc for some reason? any help is appreciated James Yes, you do need that osCsid value on the end of the links... This is called the sid, short for session id... You did mention sessions to store login details, and this is how it matches up the session of a particular customer, to that particular customer's browsing, using the session id... If you omit it from the line, then the next page you click into will assume you're a brand new viewer, and will regenerate the osCsid value to start a brand new session, which is why it keeps making you login... If you want to just make a regular text link, route it through the tep_href_link function like all of the other links on the page, and title it whatever you want... For example, using your account.php from above, you can do it 1 of 3 ways: <a href="<?php echo tep_href_link(FILENAME_ACCOUNT); ?>">Click here to login to your account</a> Orrrrr... <a href="<?php echo tep_href_link('account.php'); ?>">Click here to login to your account</a> This will automatically pull the session id value and tack it onto the end of the url line for that hyperlink... The only other way to do it would be something like this, which is pointless when there's a built-in function for doing it for you: <a href="account.php<?php echo (isset($_GET['osCsid']) ? '?osCsid=' . $_GET['osCsid'] : ''); ?>">Click here to login to your account</a> This method also makes the line the longest of the 3 methods... Richard. Richard Lindsey
Recommended Posts
Archived
This topic is now archived and is closed to further replies.